MacOS: cannot create user directory

16 views
Skip to first unread message

Paul Gilmartin

unread,
Jun 17, 2024, 5:09:12 PMJun 17
to Stellarium

677 $ pwd; ls -ld
/tmp/Darwin-23.5.0-paulgilm
drwxr-xr-x 15 paulgilm wheel 480 Jun 17 14:39 .
678 $ stellarium --user-dir us
User config directory does not exist: "us"
Creating directory "us"
Error: cannot create user config directory: Could not create directory: us
Abort trap: 6
679
I assume I'm breaking some rule, but what is it?

Must user-dir name a fully-qualified path?

And if I create "us", it fails, but later:
-------------------------------------------------------------
[ This is Stellarium 24.1 (v24.1.0) - https://stellarium.org/ ]
[ Copyright (C) 2000-2024 Stellarium Developers ]
-------------------------------------------------------------
Writing log file to: us/log.txt
File search paths:
[0]: us
[1]: /Applications/Stellarium.app/Contents/Resources
...
Creating directory "us/stars/default"
Could not create directory: us/stars/default
Could not create configuration file stars/default/starsConfig.json
Abort trap: 6
682 $ ls -al us
total 32
drwxr-xr-x 5 paulgilm wheel 160 Jun 17 14:54 .
drwxr-xr-x 16 paulgilm wheel 512 Jun 17 14:54 ..
-rw-r--r-- 1 paulgilm wheel 12033 Jun 17 14:54 config.ini
-rw-r--r-- 1 paulgilm wheel 4007 Jun 17 14:54 log.txt
-rw-r--r-- 1 paulgilm wheel 0 Jun 17 14:54 output.txt
683 $

Stellarium fails to notify me of invalid options:
"stellarium --wombat" starts normally.

--
Thanks,
gil

Georg Zotti

unread,
Jun 17, 2024, 5:33:28 PMJun 17
to Stellarium
The usual application of this feature is to take a pre-made directory, renaming it and using it for particular purposes.  
I assume (without testing myself [limited to a different platform] or checking sources etc.) the directory must exist and likely should be user-writable, and yes, the path may need to be fully qualified. Please report if that is not the answer that works.

Paul Gilmartin

unread,
Jun 17, 2024, 6:59:30 PMJun 17
to stell...@googlegroups.com
On 6/17/24 15:33, Georg Zotti wrote:
> The usual application of this feature is to take a pre-made directory, renaming it and using it for particular purposes.
> I assume (without testing myself [limited to a different platform] or checking sources etc.) the directory must exist and likely should be user-writable, and yes, the path may need to be fully qualified. Please report if that is not the answer that works.
> ...
> Stellarium fails to notify me of invalid options:
> "stellarium --wombat" starts normally.
> .
If I supply a fully-qualified path to a user-dir before
creating it, stellar creates it, populates it, and starts
normally.

If I create an empty directory and supply a --user-dir
relative to the directory path relative to the directory
in which I issue the "stellarium" command, stellarium
uses it, partially popullat4es it, then fails attempting
to create additional content.

That's frightening. The most likely explanation is that
stellarium does chdir("someplace else"); and attempts to
create more content in my path relative to "someplace else",
corrupting whatever storage is there.

It would be far better if stellarium checked at startup
and failed immediately if I supplied an incompletely
qualified path.

And the requirement should be documented in guide.pdf.

--
Thanks,
gil

Georg Zotti

unread,
Jun 25, 2024, 3:21:51 PM (12 days ago) Jun 25
to Stellarium
Much better: Fix this behaviour...
As said, apparently no developer has ever expected this path of operation.
Thanks for the diagnosis. Such problems should be reported as issues on github. I think I have found a solution.

Paul Gilmartin

unread,
Jun 25, 2024, 4:34:17 PM (12 days ago) Jun 25
to stell...@googlegroups.com
On 6/25/24 13:21, Georg Zotti wrote:
> Much better: Fix this behaviour...
> As said, apparently no developer has ever expected this path of operation.
> Thanks for the diagnosis. Such problems should be reported as issues on github. I think I have found a solution.
> https://github.com/Stellarium/stellarium/pull/3780
> .
Comment added in github:

If I create an empty directory and supply a --user-dir
relative to the directory path relative to the directory
in which I issue the "stellarium" command, stellarium
uses it, partially popullat4es it, then fails attempting
to create additional content.

I consider that dangerous because it appears unpredictable
where Stellarium tries to create content if user-directory is
not absolute

It would be better if Stellarium simply failed on a relative path.

Even better if it used realpath() or an equivalent utility to qualify
a relative path relative to the starting directory and used the
resulting value consistently thereafter.

--
Thanks,
gil
Reply all
Reply to author
Forward
0 new messages