Files app edit feature overwriting files

I check the github issues and didn’t see this yet so I apologize if it’s already known.

We are getting reports that files are being completely overwritten when users use the ‘edit’ button in the Files app. I’m unable to replicate this exact behavior but what I am seeing so far is:

  • changes made and saved to file don’t show up after it’s closed and re-opened
  • formatting is completely changed after editing a file, saving, closing, and reopening
  • when I go to edit a file an error displays very quickly in the window before opening the file. I can’t get the full error but can at least read “failed to open” - but then the file opens

In the user’s error.log file I’m seeing this but it doesn’t look like an error:
App 30026 output: [2021-06-09 08:02:57 -0400 ] INFO “method=GET path=/pun/sys/dashboard/files/edit/user/djm29/tardirs2.sh format=html controller=FilesController action=edit status=200 duration=82.63 view=1.66”
App 30026 output: [2021-06-09 08:02:58 -0400 ] INFO “method=GET path=/pun/sys/dashboard/files/api/v1/fs/user/djm29/tardirs2.sh format=html controller=FilesController action=fs status=200 duration=48.49 view=0.00”

Can you let me know if you’re able to replicate this or what other tests I can do to help you troubleshoot this? Also, is there a way to disable the ‘edit’ option on the menu until we can get this corrected? Thank you very much!
Dori

We got a report about a file being zeroed. I wasn’t able to replicate either so I just haven’t opened ticket yet because I don’t fully understand the problem. Which I now have a growing suspicion that it may not be a one off? In any case, we definitely need to look into it.

You can chmod on the directory /var/www/ood/apps/sys/file-editor/ or the file /var/www/ood/apps/sys/file-editor/manifest.yml so that it’s unreadable by regular users. That’ll disable the file editor altogether, but I now wonder if it’ll also remove the buttons (I’d be surprised if it did now that I think about it).

1 Like

Let me know if I can provide any assistance with troubleshooting. I can’t seem to figure out how to grab that error that flashes by when I open files.

Jeff, I have an example from a user that I can replicate the problem. It might be the file format: Bourne-Again shell script, UTF-8 Unicode text executable, with very long lines

I can send it to you if you want to try it on your end. It’s not a long file, only 91 lines, but some of the lines are very long. It might be the encoding though.

Thank you so much! yes attach it to this ticket (I think if you save as a .txt you can). I was going to ask if there are issues with formatting what formats are involved (yml, json, etc).

I just opened this ticket too. Thank you so much for letting us know! This just became high priority for us.