-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Running shards works for root, not for normal user #6965
Comments
I've also noticed this under rootless podman containers. |
This issue isn't related to Crystal itself, but the shards package manager. Please open the issue in this project: https://github.com/crystal-lang/crystal/shards |
Doesn't look like it's specific to And |
I use LXC containers everyday, and never had such an issue. I would easily blame systemd, maybe. |
@rodti are you sure you have read/write permissions on the directories used by Unhandled exception: Error opening file '/srv/shard.yml' with mode 'w': Permission denied (Errno)
Failed to raise an exception: END_OF_STACK
[0x557996f25c56] *CallStack::print_backtrace:Int32 +118
[0x557996f08b46] __crystal_raise +86
[0x557996f090ee] *raise<Errno>:NoReturn +206
[0x557996f5b3d9] *Crystal::System::File::open<String, String, File::Permissions>:Int32 +201
[0x557996f50a0d] *File::new<String, String, File::Permissions, Nil, Nil>:File +45
[0x557996f1d3dd] *CallStack::read_dwarf_sections:(Array(Tuple(UInt64, UInt64, String)) | Nil) +109
[0x557996f1d11d] *CallStack::decode_line_number<UInt64>:Tuple(String | Nil, Int32, Int32) +45
[0x557996f1c8c8] *CallStack#decode_backtrace:Array(String) +296
[0x557996f1c782] *CallStack#printable_backtrace:Array(String)+ +50
[0x557996f5063d] *Exception+ +77
[0x557996f50088] *Exception+ +120
[0x557996fa0978] *AtExitHandlers::run<Int32>:Int32 +488
[0x557996f85654] *Crystal::main<Int32, Pointer(Pointer(UInt8))>:Int32 +148
[0x557996f13816] main +6
[0x7f2aaa8ccad6] __libc_start_main +54 I got this by compiling shards statically with Failed to raise an exception: END_OF_STACK
[0x0] ??? |
Hi everyone, apologies for the delay in replying. I've created a brand new LXC container on a different Proxmox (pve 5.2-2) host. This uses a Debian 9.3.1 image. I've run I then ran Running
Running
Running
Running
Happy to share any logs if required. |
Your container is restricting access to something that Crystal depends on (e.g. a file from /dev or proc). You can use
|
Thanks for the tip. I've run strace and it was failing on /dev/tty1 access. I've changed the permissions on /dev/tty1 to a fairly loose 777 and it now works correctly. Odd that it needs a workaround though! |
Related to #6518 |
When I went to apply the fix to the container where I noticed this issue it was /dev/pts3 rather than /dev/tty1, but adding the user to group tty and setting permissions to 660 worked. I'm assuming this is a peculiarity of LXC and not Crystal, so will close this issue. |
Clean install of Crystal (via aptitude) on Debian 9, running in a Proxmox LXC container.
Running shards as root gives expected results:
Missing shard.yml. Please run 'shards init'
Running shards for any other normal user account (without sudo) crashes:
I also get a crash running crystal as a normal user. I've tried this with several new user accounts, all have the same issue.
Also, out of abundance of caution, I've tried this on both unprivileged and privileged LXC containers, with identical results.
The text was updated successfully, but these errors were encountered: