Author Topic: Can't edit document, but revisions are saved in the filesystem  (Read 5180 times)

interfaSys

  • Guest
Can't edit document, but revisions are saved in the filesystem
« on: September 23, 2011, 04:03:16 pm »
Hello,
I'm running into a strange issue with the document editor.
Whenever I want to edit a text file, I get an error message at the top letting me know that an error has occurred.
There is no error in cache/log.php, but I can see new revisions being saved in the upload folder.
Is this a bug or do I have a permission problem? I've fixed the permissions of the HTMLPurifier (not indicated in the doc afaik), but there may be some other problems.

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #1 on: September 28, 2011, 12:40:03 pm »
Hi there.
It does sound odd and we cannot reproduce such problem, but if new revisions are made and you can access them, you should not worry much about it I guess

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

interfaSys

  • Guest
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #2 on: October 14, 2011, 04:24:16 pm »
Hello Fransisco,

Thank you for your reply. If you can't reproduce it, then it must be some sort of permission problem, but I'm not sure where to look.
I cannot access the revisions and they are not created in the application. They only exist in the file system. It's as if the 'saving' tasks could not be completed for some reason.
Do you have any idea of what could be the problem?

Kind regards,

Olivier


franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #3 on: November 03, 2011, 11:37:50 am »
I am sorry but I would not know what the problem is without actually debugging the code or looking into the installation.
May be you should do that.. start throwing alerts or something until you figure out what the issue is?

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

interfaSys

  • Guest
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #4 on: October 13, 2012, 08:44:40 pm »
It's still an issue in 2.2.

Files are created in 3 nested folders
f1/f2/f3/file111111111111

and the script is looking for a non-existent reference

Code: [Select]
#1 FATAL: exception 'FileNotInRepositoryError' with message 'File '8c31185c9257489fa8b07134dfe646e1ddde6fae' can not be found in the repository' in /library/filerepository/backend/FileRepository_Backend_FileSystem.class.php:82
    Stack trace:
    #0 /library/filerepository/FileRepository.class.php(58): FileRepository_Backend_FileSystem->getFileContent('8c31185c9257489...')
    #1 /application/models/project_file_revisions/ProjectFileRevision.class.php(79): FileRepository::getFileContent('8c31185c9257489...')
    #2 /application/models/project_files/ProjectFile.class.php(300): ProjectFileRevision->getFileContent()
    #3 /application/models/project_files/ProjectFile.class.php(429): ProjectFile->getFileContent()
    #4 /application/controllers/FilesController.class.php(2273): ProjectFile->getFileContentWithRealUrls()
    #5 /application/controllers/FeedController.class.php(267): FilesController->display_content()
    #6 /environment/classes/controller/Controller.class.php(76): FeedController->display_content()
    #7 /environment/classes/controller/PageController.class.php(62): Controller->execute('display_content')
    #8 /environment/classes/Env.class.php(163): PageController->execute('display_content')
    #9 /init.php(165): Env::executeAction('feed', 'display_content')
    #10 /index.php(9): require('/...')
    #11 {main}
Time since start: 0.033255100250244 seconds

There is no file 8c31185c9257489fa8b07134dfe646e1ddde6fae

There is only this folder+file combo:
54c/901/2b5/e442ac6f3ab66ebbd35ac0de3c08c71

and all the other folders which are created every time a user presses "save"

Step to reproduce with a standard user (non-admin):
1) Upload a text file, no need to attach it to a workspace
2) In the right column, select "Edit this file"
3) Add one line
4) Click Save

Expected result:
Success!

What happens instead:
An error occurred while saving the document
« Last Edit: October 13, 2012, 08:56:58 pm by interfaSys »

interfaSys

  • Guest
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #5 on: October 14, 2014, 10:59:06 am »
Tested again on 2.7.x and it's still not working

Env
FreeBSD 9
PHP-FPM 5.4
Files stored in the filesystem

Step to reproduce
1) Upload a text file, no need to attach it to a workspace
2) In the right column, select "Edit this file"
3) Add one line
4) Click Save

Expected result
Success!

What happens instead
There is a message saying that "An error occurred while saving the document"

There is absolutely nothing logged anywhere (FO, PHP, Apache, suhosin, mod_sec, JS console), including in debug mode.

The Apache logs show a succesful POST attempt
"POST /index.php?context={%221%22:[0],%222%22:[0],%223%22:[0]}&currentdimension=0&ajax=true&c=files&a=text_edit&current=documents-panel HTTP/1.1" 200 1234 "https://test.tld/index.php?c=access&a=index" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"

Form data is correct (utf8, proper file content)

Response is:
Contents: Object
current: false
errorCode: 1
u: 1

Every time the user clicks "save" a bunch of nested folders are created in the file system with 777 permissions (crazy). The same permissions set for uploaded files btw.

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #6 on: October 29, 2014, 02:53:25 pm »
Hi there!

That is pretty odd to be honest as so far no one else has reported this issue.. so chances are it could be a server side settings problem.
That being said, if you have not solved the problem yet and would like further and official assistance, our Team would be delighted to help you out with it. If you are interested in this, please drop me a private message in the Forums.

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

interfaSys

  • Guest
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #7 on: October 31, 2014, 08:31:20 am »
Hello Fransisco,

This seems to be settings or database related. A fresh install did not have the problem, at first..
It's difficult to test because your sessions don't include a namespace, meaning that another install on the same setup is getting settings from the main installation.

Also, magic_quotes_gpc doesn't exist any more in any support PHP version. You may want to remove it from the server setup instructions. Comments are not working in the wiki.

Cheers,

Olivier

interfaSys

  • Guest
Re: Can't edit document, but revisions are saved in the filesystem
« Reply #8 on: October 31, 2014, 09:07:02 am »
Found the problem

Administration > Configuration > General
File revision comments required: yes

My suggestions
- Better error message
- Add revision comment box to txt file editing
- Fix View history > Modifications which is currently always empty
- Isolate sessions so that concurrent installations don't break

Cheers,

Olivier