[Solved] File save issues on Synology NAS

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

[Solved] File save issues on Synology NAS

Postby sawozny » Wed Jan 23, 2019 6:46 pm

Greetings Gurus!

I recently upgraded from Ubuntu 16.04 to 18.04 to support the newest version of the accounting software I want to use (which was as nightmare in and of itself where I learned more about legacy BIOS / MBR vs UEFI / GPT disks than I ever thought I would need to) and part of that process was reinstalling FreeCAD using the Bionic PPA. During that process, I launched the app and opened some files and everything appeared OK, so I considered the reinstall a success. Now that I’m back to actually USING the software, I have run into a couple disk related problems (one small and one large) that I’d like to know if anyone has any suggestions on how to resolve.

So, I have a Synology Diskstation DS216j NAS with a single password-protected SMB share that I keep all my files on. Not one iota of trouble creating, retrieving or updating files when I was on FreeCAD 16 / Ubuntu 16 (when I got the NAS) and no problems when I upgraded to FreeCAD 17 last year. Now, on my present configuration, 2 new problems have manifested and I don’t know how to identify the cause, let alone troubleshoot.

First the minor issue, new files are no longer saved with a .fcstd extension. At all. Anywhere (this becomes a salient point, shortly). Previously, when I saved a new file I did what I do in pretty much any other app and just entered the file name in the dialog box and the app assigns the extension. Now, there is no extension when I go look in the file manager. I can add it manually in the file save dialog and I can add it in the file manager after closing the file in FreeCAD, but after my upgrade it doesn’t save the extension automatically anymore, whether I save to the NAS or to my local desktop. This is kind of a PITA, but not the end of the world, and I probably wouldn’t have bothered the forum with it, except I also have a bigger issue that may or may not be related.

The major issue is that when I save FreeCAD files to the NAS now (either a new file or an update to an existing file on the NAS) FreeCAD creates the file, but it’s zero bytes. No error message appears, so I think everything is fine until I try to open up the file again and find out it’s empty. I found this with a little throwaway part because I needed to reboot from my Linux desktop to my Windows desktop for a specialized version of my slicing software that only runs on Windows. Fortunately, there wasn’t a ton of work lost, but I started troubleshooting and this issue only manifests when saving to the NAS. I can save to my local desktop and move the file to the NAS and open the file there and everything is fine, but I can’t save to the NAS despite the dialog allowing me to navigate through the NAS file structure and giving me no negative feedback when I hit the save button. Also, when opening an otherwise good file on the NAS, if I make a change and save it, the file goes to 0 bytes, like the new files. This issue also manifests itself (file appears where it’s supposed to, but zero bytes) when doing an STL export, not just using the main Save dialog.

I know this probably isn’t an actual FreeCAD issue, but LibreOffice files save fine directly to the NAS so if I’m going to take this to Ubuntu and / or Synology, I need some sort of error log but I can’t seem to find any log lines to indicate what the actual issue is. Is there a way to turn on debug level logging for file operations so I can start to pin down this issue?

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)

The version appears to be the most current. I searched the forum, but there have been a lot of file save problems, none of which seem to apply to me. I have included the before and after test cube files, but I don’t expect them to yield anything significant. Frankly, I think this is Ubuntu and the SMB share on the NAS fighting, but I think I’m going to need some actual error data to take it to them and the primary reason for my post here is to find out how to find that.

Any help or suggestions would be greatly appreciated.

Thanks,

Scott
Last edited by sawozny on Sun Feb 10, 2019 11:29 pm, edited 1 time in total.
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Wed Jan 23, 2019 6:53 pm

Crap... Forgot to attach the files. Sorry. I attached the "before" which is just a default cube from the part workbench. The "after" won't attach because the BB says it's too large, even though it's 0 bytes. So I zipped it to give it some volume. :)
Attachments
Cube Test after.zip
(222 Bytes) Downloaded 4 times
Cube Test.fcstd
(3.32 KiB) Downloaded 2 times
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Wed Jan 23, 2019 6:57 pm

Sorry, one more thing I just saw. When I open the file on the NAS and then let FreeCAD sit there for a while, the backup file with the .fcstd1 extension eventually appears and it's written to disk properly. So it appears my issue only manifests when doing an active save from a GUI, not a background autosave. Is there a way to identify, at the disk operation level, how those processes are different?
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: File save issues on Synology NAS

Postby triplus » Wed Jan 23, 2019 7:23 pm

Hi Scott.

If the file extension is not added automatically, that could indicate a native file dialog is being used. There is a runtime option to control this, but only available in FreeCAD 0.18+:

https://forum.freecadweb.org/viewtopic. ... 68#p273068

Could you install FreeCAD 0.18 from the daily PPA or test with the FreeCAD 0.18 AppImage:

https://github.com/FreeCAD/FreeCAD/releases

Once FreeCAD 0.18 gets started:

Code: Select all

p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Dialog")
p.RemBool("DontUseNativeDialog")
Copy and paste the code snippet in the FreeCAD Python console. Just to make sure you haven't enabled this option in the past. After create a new file and try to save it. To see if the extension will now be added automatically, and if other issues will still persist.
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Wed Jan 23, 2019 7:42 pm

Will do. Should I uninstall 17 first and then install 18 or can I install them both in parallel? If I should uninstall and install are there any steps I should take beyond the apt-get remove (deleting folders in my home dir etc...) to make sure 17 is really gone before installing 18?

Thanks,

Scott
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: File save issues on Synology NAS

Postby triplus » Wed Jan 23, 2019 8:54 pm

FreeCAD versions installed from the stable/daily PPA should run in parallel.

P.S. AppImage doesn't require installation (download, make executable and run).
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Wed Jan 23, 2019 9:07 pm

I was just about to fall on my sword after realizing freecad and freecad-daily should totally run in parallel, but you beat me to it. :)

So, I installed freecad-daily from the PPA and ran it. I first created my test cube and tried to save to the local desktop which it did with no problem and the correct extension. I then tried saving to my NAS and got the error dialog: "Failed to open file: Test Cube.FCStd. 4d543094-647a-45a3-8b79-1fd0c0278cb5"

I then closed and reopened freecad-daily and ran the 2 lines in the python console you recommended and created another cube and tried to save. Same results. The extension problem doesn't happen in 18, but saving to the SMB share on the NAS still doesn't work.

As I mentioned, I'm sure this isn't an actual FreeCAD problem as, if it was, I'm sure more people would be reporting it. As a matter of fact, it all worked fine for me before my upgrade to Ubuntu 18.04. It seems to be between the OS and the NAS and something specific about how FreeCAD writes files to disk through a dialog vs. auto-saving (which seems to work fine). Is there any where you can recommend that I can check for warnings or errors generated during a disk operation executed through a dialog?

Thanks,

Scott
triplus
Posts: 8605
Joined: Mon Dec 12, 2011 4:45 pm

Re: File save issues on Synology NAS

Postby triplus » Wed Jan 23, 2019 9:30 pm

Hi Scott

I read your question and detected two separate issues. One being related to adding extension automatically on save operation. And the second issues related to failures when trying to save to NAS directly. For now i only focused on the first problem. Therefore in FreeCAD 0.18 you do get the extension by default now? And if you test again with FreeCAD 0.17 from the stable PPA? Does the extension get added? If not i am guessing somehow native file dialog got enabled (likely on build time).

As for the second issue. If it worked before on Ubuntu 16.04, there is a chance a regression was introduced in one of the components on Ubuntu 18.04. This things are usually a bit tricky to figure out, without doing some testing. Maybe you could go over the whole procedure again, enabling the SMB share, and to hopefully get more clues in the process.
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Sat Jan 26, 2019 5:48 pm

Ah, sorry, I should have kept those issues separate. So, on the file extension issue, the results of testing were that in v18 files are saved with the extension both on default install and after running the 2 python commands you suggested. In v17, files are not saved with the extension unless I explicitly add it in the save dialog. This is more of an inconvenience to me than a significant issue.

Separately, the second issue is what I'm much more interested in solving. The only isolation testing I've been able to do so far is when I save from v17 or v18 to the local file system, the file saves fine (just without the extension in v17 which I'm not particularly worried about) but when I save to the SMB share on the Synology NAS, the file appears, but is zero bytes. This has only started happening since I upgraded to Ubuntu 18.04. All I'm really looking for is if there is any logging (or way to enable logging) on any disk operations conducted by FreeCAD. In my experience there is often a seemingly innocuous warning that will put me on the right track, either with Ubuntu or Synology, but right now I get no screen feedback that anything has gone wrong so I'm desperately searching for some kind of log data to support that this is really happening and put me on the track of why.

In the absence of any such log data, I may try re-installing v17. Are there any user preference folders left behind after the removal of a PPA based install so I can make sure I'm doing a truly clean re-install? I am also considering switching this to an NFS share, but I'd prefer not to do that as it adds the hassle of maintaining NFS clients on my Windows workstations. I can't think of anything else to do in the absence of any log data on disk operations.
sawozny
Posts: 20
Joined: Mon Aug 31, 2015 9:21 pm
Location: NYC

Re: File save issues on Synology NAS

Postby sawozny » Sat Jan 26, 2019 7:37 pm

FYI, I did some digging around the log files of the OS and found a repeated error: "mkdir failed on directory /var/cache/samba: Permission denied" which led me to Ubuntu bug 1758653. It made me wonder if this is the error I was looking for. The suggestion was to install samba-common or samba-common-bin to resolve the issue which I did but even though the error that put me on this path is gone, FreeCAD files saved to the SMB share on the DiskStation NAS are still 0 bytes.

After this, I did an uninstall of freecad, freecad-doc and freecad-daily as well as removing the PPAs from the Software & Updates app and cleaning out any remaining files I could find with a 'find / -name freecad*' and 'find / -name FreeCAD*' and then re-adding the PPA and re-installing freecad and freecad-doc but any FreeCAD files written to the SMB share on the NAS when I do a save are still 0 bytes.

In addition, I found the logging switch for FreeCAD but wasn't able to find anything in those logs related to disk operations at all, let alone any warnings or errors.

I can't find anything that looks even remotely like my issue in either Ubuntu or Synology's forums but I'll also try posting there. Perhaps NFS is my answer, but that sounds like a much bigger change so I think it will wait for last.

Can anyone think of anything obvious I'm missing here?

Thanks,

Scott