Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

‘/opt/rakudo-pkg/share/perl6/vendor/short’: Permission denied #78

Closed
ToddAndMargo opened this issue Feb 13, 2021 · 25 comments
Closed

Comments

@ToddAndMargo
Copy link

Dear Rakudo-pkg,

Fedora 33, x64

After updating from

 https://github.com/nxadm/rakudo-pkg/releases

 RakudoPkgFedora33-2020.12.x86_64.rpm
 -->
 RakudoPkgFedora33-2020.12.04.x86_64.rpm

I now am getting a TON of warning errors when I start
up my programs. The programs do run:

WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it as handled by calling .Bool, .so, .not, or .defined methods. The Failure was:
Failed to create directory '/opt/rakudo-pkg/share/perl6/vendor/short' with mode '0o777': Failed to mkdir: Permission denied
in any statement_control at /opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
in any package_declarator:sym at /opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
in any package_declarator at /opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
in any scope_declarator:sym at /opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
<about 50 more>

perl6 is owned by root with 755 ownership
$ ls -al /opt/rakudo-pkg/share/perl6/vendor
total 12
drwxr-xr-x. 2 root root 4096 Feb 12 17:13 .
drwxr-xr-x. 13 root root 4096 Nov 4 2019 ..
-rw-r--r--. 1 root root 1 Feb 12 03:00 version

The error is reproducible:
$ mkdir /opt/rakudo-pkg/share/perl6/vendor/short
mkdir: cannot create directory ‘/opt/rakudo-pkg/share/perl6/vendor/short’: Permission denied

The following command does shut it up:

$ pwd
/opt/rakudo-pkg/share/perl6/vendor
$ su root -c "mkdir short; chmod -R 2777 short"

And after running a program:
$ ls -al /opt/rakudo-pkg/share/perl6/vendor
total 16
drwxr-xr-x. 3 root root 4096 Feb 13 12:21 .
drwxr-xr-x. 13 root root 4096 Nov 4 2019 ..
drwxrwsrwx. 2 root root 4096 Feb 13 12:21 short
-rw-r--r--. 1 root root 1 Feb 12 03:00 version

"short" retains it ownership.

What gives? A bug in the installer?

Many thanks,
-T

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

Hi @ToddAndMargo,

I just launched a Fedora:33 container and I can't reproduce the problem:

# curl -1sLf 'https://dl.cloudsmith.io/public/nxadm-pkgs/rakudo-pkg/setup.rpm.sh' | sudo -E bash
Executing the  setup script for the 'nxadm-pkgs/rakudo-pkg' repository ...
[...]
# dnf install rakudo-pkg
[...]
# source /etc/profile.d/rakudo-pkg.sh 
# raku -v
Welcome to Rakudo(tm) v2020.12.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2020.12.
# cat /test.raku
#!/usr/bin/env raku
say "foo"
# /test.raku 
foo
# adduser -m nxadm
# su - nxadm
$ /test.raku 
foo

I think of 2 possible cult-pits:

  • Your directory directory are broken: better remove the package and install it again instead of upgrading manually.
  • You may be missing the newly introduced libzstd MoarVM (declared in the package). If you install from the Fedora repo it should be installed automatically.

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Feb 13, 2021 via email

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

$ rpm -qa rakudo-pkg
rakudo-pkg-2020.12.0-04.x86_64

@ToddAndMargo
Copy link
Author

Maybe it was because I have been upgrading and yours was fresh

@ToddAndMargo
Copy link
Author

What does
$ ls -al /opt/rakudo-pkg/share/perl6/vendor
show?

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

$ ls -al /opt/rakudo-pkg/share/perl6/vendor
total 12
drwxr-xr-x 2 root root 4096 Feb 13 20:35 .
drwxr-xr-x 7 root root 4096 Feb 13 20:35 ..
-rw-r--r-- 1 root root    1 Feb 12 11:02 version

@ToddAndMargo
Copy link
Author

ToddAndMargo commented Feb 13, 2021

Here is mine

$ ls -al /opt/rakudo-pkg/share/perl6/vendor
total 16
drwxr-xr-x. 3 root root 4096 Feb 13 12:21 .
drwxr-xr-x. 13 root root 4096 Nov 4 2019 ..
drwxrwsrwx. 2 root root 4096 Feb 13 12:21 short
-rw-r--r--. 1 root root 1 Feb 12 03:00 version

The problem did not go away until I created "short" manually with 2777.

Is the installer suppose to create "short" for you?

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

No, the package does 3 things:

  • declare a dependency to libzstd on system that have it.
  • put files in /opt/rakudo-pkg
  • create a symlink in /etc/profile.d/ to /opt/rakudo-pkg/bin/rakudo-pkg.sh to set the PATH

That's it. On my ubuntu install the upgrade happend without problems even when changing repo's and gpg keys (from bintray to cloudsmith).

@ToddAndMargo
Copy link
Author

Hmmmmm. Maybe it is because I upgraded.

"short" has to be there on mine to avoid all the warning errors.

Can you try creating another container of Fedora 33, installing RakudoPkgFedora33-2020.12.x86_64.rpm, run a program, then upgrade to RakudoPkgFedora33-2020.12.04.x86_64.rpm and see what happens?

@ToddAndMargo
Copy link
Author

It would help if I knew the purpose of the "short" directory.

@ToddAndMargo
Copy link
Author

Hmmm. I am using custom modules out the wazoo. Did your test program use custom modules that had to be precompiled?

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

Maybe the root and user installed modules got mixed up?

/opt/rakudo-pkg/bin/zef installs in /opt/rakudo-pkg and need roots privileges, while zef in the user's $HOME (e.g. installed with /opt/rakudo-pkg/bin/install-zef-as-user) will install the modules in the precomp dirs in the $HOME. The second option is the way to go.

@ToddAndMargo
Copy link
Author

I have not zef'ed any of my custom modules. I am always modifying them.

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

Ok, I think I can reproduce the error.

Weirdly enough, it went away once I logout as the user and logged in again.

@nxadm
Copy link
Owner

nxadm commented Feb 13, 2021

Or not :/

[nxadm@5fbe63f39dd1 ~]$ echo "class TestLib { }" > TestLib.rakumod
[nxadm@5fbe63f39dd1 ~]$ raku -I. -MTestLib -e "say 'foo'"
foo

If it happens, can you delete your .precomp directory?

@ToddAndMargo
Copy link
Author

Since I created the directory, everything is working fine.

@ToddAndMargo
Copy link
Author

Hmmm. I am using custom modules out the wazoo. Did your test program use custom modules that had to be precompiled?

@ToddAndMargo
Copy link
Author

$ echo "class TestLib { }" > TestLib.rakumod
$ raku -I. -MTestLib -e "say 'foo'"

Just hangs

@nxadm
Copy link
Owner

nxadm commented Feb 20, 2021

I saw a post about it here: https://www.reddit.com/r/rakulang/comments/kz78y2/running_as_a_service_under_an_unprivileged_user/.

I am checking with upstream to check if it's an error in Rakudo release and if it could be fixed on the upcoming release.

@nxadm
Copy link
Owner

nxadm commented Feb 20, 2021

I did rm -rf ~/,perl6 and ~/.raku and I can no longer reproduce the problem. It looks like precomp gone wrong.

@nxadm
Copy link
Owner

nxadm commented Feb 20, 2021

Upstream issue: rakudo/rakudo#1515

@nxadm
Copy link
Owner

nxadm commented Mar 1, 2021

Testing changes to sidestep the issue. New packages should be up very soon.

@nxadm
Copy link
Owner

nxadm commented Mar 1, 2021

New packages are being released now. See #80.

@nxadm nxadm closed this as completed Mar 1, 2021
nxadm added a commit that referenced this issue Mar 1, 2021
@nxadm
Copy link
Owner

nxadm commented Mar 14, 2021

@ToddAndMargo See #81 (comment).

Thx for your input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants