Author Topic: Saving projects on Mac fails after some time: Unable to open file  (Read 1157 times)

Offline stephan

  • Newcomer
  • Posts: 3
    • View Profile
When saving my project I get this error (see screenshot) and saving stops.

My assumption is as follows: I typically only work in the evenings on my project and keep PixInsight running over several days with all files open. No need to close it. Now, Mac OS X seems to remove tmp files in /var/folders when they are not accessed for 3 days.
See the man page for confstr:
Code: [Select]
     _CS_DARWIN_USER_TEMP_DIR
             Provides the path to a user's temporary items directory. The directory will be created it if does not already
             exist. This directory is created with access permissions of 0700 and restricted by the umask(2) of the calling
             process and is a good location for temporary files.

             By default, files in this location may be cleaned (removed) by the system if they are not accessed in 3 days.

I'm not sure which operation accesses the image files once they are in memory. So I guess after 3 days a project cannot be saved anymore on Mac OS X.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4387
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #1 on: 2017 November 22 13:44:16 »
this unfortunately is a longstanding issue - juan is aware of it and attempted to fix it in the latest release, by finding a more appropriate place for swap files than /tmp. but i think he said the system-provided user-directory scratch space directory names keep changing on him, so he had to find another approach.

there is a launchd script which causes /tmp to be cleaned out every 3 days (IIRC.) however, you can edit the script using the shell to add *.swp as a type of file that won't be deleted. this is the solution i've been using for years...

https://superuser.com/questions/187071/in-macos-how-often-is-tmp-deleted

rob

Offline stephan

  • Newcomer
  • Posts: 3
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #2 on: 2017 November 22 13:54:06 »
Hi Rob,
Thanks a lot! That should help...

May be Juan could periodically touch those swp files or trigger any other no-operation that will only update the access time of those files. That would avoid loosing whole projects which is actually a real show-stopper.

Regards,
Stephan

Offline Greg Schwimer

  • PixInsight Addict
  • ***
  • Posts: 204
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #3 on: 2017 December 25 20:49:38 »
Oh, this has bitten me in a not good way!

I got around it by creating a tmp folder in my home directory (~/tmp/pixinsight) and configuring PI to use that for temp files. You can edit this setting in Global Preferences->Directories and Network.
- Greg
Scottsdale, Arizona, USA

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4387
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #4 on: 2017 December 25 20:52:58 »
i have found that occasionally my swap directory gets reset back to /tmp (i am using 3 SSDs and i had configured PI to write files to those 3 SSDs, none of which are /tmp)... i don't know if this is an actual bug, or perhaps when upgrading PI the settings got reset, or what, but it's worth periodically making sure your swap files are not being written to /tmp when you first fire up PI. i don't think the directory gets reset if it's been set while PI is running - it seems to have gotten reset between launches.

rob

Offline Greg Schwimer

  • PixInsight Addict
  • ***
  • Posts: 204
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #5 on: 2017 December 25 21:24:09 »
Interesting and good to know. I've not had that happen to me before.

I save my global settings as a process icon. I think there's a way to run a start-up script? Maybe have it re-import your settings at each start.
- Greg
Scottsdale, Arizona, USA

Offline stephan

  • Newcomer
  • Posts: 3
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #6 on: 2017 December 31 06:05:53 »
May be I specified it in the wrong way by adding *.swp instead of .swp to the ignore list. Fact is, my image's swap file was deleted anyway and PI finally crashed after some process could not access it anymore. This is really bad.

I now will choose a static tmp dir from my home directory as suggested above.

BTW: Is there any bug tracker where the status of PI bugs can be tracked or is it just this forum?

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4387
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #7 on: 2017 December 31 10:48:42 »
its just the forum. there is a PCL github - i think there might be an issue tracker built into github but not sure if it is activated?

rob

Offline storyface

  • Newcomer
  • Posts: 6
    • View Profile
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #8 on: 2018 December 18 09:44:29 »
Absurd. I have now lost an entire project because of this ridiculous bug that results from entirely known and predictable behavior of the OS. This is the kind of thing you expect to find in a beta, or a garbage freeware application. Amateur hour.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6782
    • View Profile
    • http://pixinsight.com/
Re: Saving projects on Mac fails after some time: Unable to open file
« Reply #9 on: 2018 December 19 05:45:24 »
This problem has been solved in a new version of PixInsight that I am going to release today, not just for macOS, but for all supported platforms. The fix was intended to be part of the initial 1.8.6 version, but unfortunately I forgot to include it in the final builds.

Besides this, I am sure you can find other image processing applications that have been written by much less amateur developers. I encourage you to use them instead of PixInsight.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/