/srv/irclogs.ubuntu.com/2022/11/07/#ubuntu-server.txt

=== arraybolt3_ is now known as arraybolt3
=== arraybolt3_ is now known as arraybolt3
=== keithzg_ is now known as keithzg
guesswhatis some amd gpu driver required for 6800U laptop cpu, or is it already included in kernel?08:27
odcguesswhat: it's in the kernel, but I'm not sure if 5.19 is recent enough 09:11
guesswhatodc got spikes 100% in google meeting09:11
guesswhatchrome with hw accel enabled09:11
odcOuch09:12
guesswhat`lspci -k | grep -A 3 -E "(VGA|3D)"` using amdgpu module09:12
guesswhathttps://www.phoronix.com/news/AMD-Radeon-680M-Linux-Mesa09:14
guesswhatshoud be fine09:14
=== jgee118 is now known as jgee11
fooHmm, nginx-logs throwing this: live/live.sock failed (13: Permission denied) while connecting to upstream, client ... live.sock is 777 which is what I have on another system which works. Ubuntu 22.04, new system. Perms seem ok. Python + gunicorn + nginx. Any sugggestions? 18:22
fooSpent hours on this already, running out of ideas18:22
adacHi there! it is strange my htop and iotop command on the server are loadning really really slow. What can cause that actually?18:29
adacI was checking the read/write and disk io, but all seems normal in this regard18:30
adacwhile the server has some decent load, it still has a lot of free resources18:30
adacHow can I properly debug this?18:30
effendy[m]adac: what else is slow?18:40
effendy[m]maybe they're trying to read off a remote disk/share of some sorts also?18:41
sdezielfoo: `namei -l /path/to/live/live.sock` would help so would seeing your nginx config18:42
adaceffendy[m], actually "ls" and all this normal commands, "pwd" all this is working very fast18:42
adaceffendy[m], actually I run a bare metal kubernetes cluster on this server (3 servers actually). Within this cluster I do some smb mounts with this guy: https://github.com/kubernetes-csi/csi-driver-smb but other then that, and this never made any issues so far on other clusters I have, I do not read from remote disks or so18:47
effendy[m]It might be related to that though, but this is just a supposition.18:49
effendy[m]If there was any way you could disable it temporarily, it would interesting to see if it reacts in the same way.18:49
adaceffendy[m], I will try and uninstall it bit later. Just have to leave now for some time. Will inform you a bit later! Thanks for the hint!18:53
effendy[m]:)18:53
adaceffendy[m], inform only if you like to know if it worked of course :-)18:55
effendy[m]adac: I do, of course!18:56
adacperfect! :-)18:56
foosdeziel: thank you. https://bpa.st/54FQ - it's all stock19:15
sdezielfoo: please use `namei -l` as it report on the ownership/perms19:15
sdezielfoo: please also paste the relevant nginx/conf.d and nginx/sites-enabled files19:16
foosdeziel: err, sorry, I was going to say... that didn't seem too helpful. pebkac19:24
foosdeziel: thank you! https://bpa.st/R77Q19:24
foosdeziel: note, groups www-data returns www-data : www-data dev19:24
=== blackro0t is now known as blackroot
foosdeziel: I'm really curious, I've done this set up many times and not sure what I'm missing. 19:25
sdezielfoo: you likely need to edit nginx's systemd unit to add `SupplementaryGroups=dev` to it. `sudo systemctl edit nginx`19:25
sdezielfoo: cause I don't think that nginx will load the supplementaty groups when it switch UID/GID from root:root to www-data:www-data19:26
foosdeziel: thanks, testing now. I think I want to uncomment out the service from sudo systemctl edit nginx and then add SupplementaryGroups=dev to it, *googles19:29
sdezielfoo: no, you just need `[Service]\nSupplementaryGroups=dev\n`19:30
foosdeziel: ahh, thank you. It looks like the other test is: chown -R dev:www-data /home/dev/myapp19:31
sdezielfoo: hmm, I tested my SupplementalGroups= theory and it's wrong apparently, you don't need this for nginx to pick up the supplementary groups. Restarting nginx was all that was needed, no need for edits19:40
foosdeziel: huh, thank you for testing. I appreciate your thoroughness 19:40
sdezielfoo: I whipped up a quick PoC trying to mimic your setup and I don't have the permission denied problem you have :/20:06
foosdeziel: huh. 20:19
foosdeziel: FWIW, this was a brand new Ubuntu 22.04 set up. Stock everything. I pasted the service conf, nginx conf... I can't think of what else is here that's nuanced. /home/dev is a dev user, but I doubt that matters. 20:19
sdezielfoo: I setup a fresh 22.04 container, put nginx-light and created a tiny python3 service using your myapp-api.service unit...20:24
foosdeziel: I really really really appreciate you taking the time to do that. I wonder what else I can have on here that could be causing that20:26
sdezielfoo: are you using ACLs?20:39
foosdeziel: negative 20:42
sdezielfoo: maybe try enabling debug error logging for your `location /`? `error_log /var/log/nginx/myapp.err debug;`20:44
fooOh, not a bad idea - can give that a shot. 20:48
tewardsdeziel: fwiw debug logging is for the whole log for a server block not just a location21:33
tewardit's also noisy as sin (that looks like nginx)21:33
sdezielteward: https://nginx.org/en/docs/ngx_core_module.html#error_log mentions `location` as a valid context21:34
sdezielbut yeah, it's quite noisy21:34
tewardsdeziel: agreed, it's VERY noisy, i'm a little behind thoug hand am still doing scrollback to figure out what exactly is going on21:34
sdezieland no matter how I break the access to the Unix socket, the only error I can get is the permission denied...21:34
sdezielit won't tell if it cannot connect due to not having "execute right" on something or the path...21:35
tewardwelcome to how C relays access perms or not21:35
tewardyou either 'have permission' or 'don't21:35
tewardthat's not nginx that's just how C works :21:36
tewardC / filesystem notices21:36
teward*yawns* i need more coffee21:36
tewardlet me play some catchup21:36
tewardfoo: i would NOT have things live in your home directory21:40
tewardnginx runs as www-data by default in Ubuntu.  per your namei, your socket is at /home/dev/myapp/live/live.sock.  All home directories default to 750 which PREVENTS non-owner and non-group access to the directory at the /home/dev/ level.21:41
tewardwww-data does not have the ability to read or traverse into /home/dev/21:42
tewardyou have two choices:21:42
teward(1) give 'other users' traverse/read permissions to the base directory: (UNSAFE) - sudo chmod o+rx /home/dev21:42
teward(2) place your socket somewhere else such as `/var/run` or `/run` or in `/tmp` with proper 666 permissions (read/write).21:43
tewardthird choice: ACLs21:43
teward(3) explicitly give ACL permissions to the www-data user for your home directory (also still unsafe): sudo apt install acl && sudo setfacl -m u:www-data:rx /home/dev/21:44
teward(you still have to install ACL to make that work)21:44
tewardi don't think the issue lies in your *python* app but instead actually your intermediate directories between / and the actual full location of your socket.21:45
tewardsdeziel: ^^21:45
tewarddebugging logs won't help it'll just say permission denied21:45
tewardbut such things should be taking after programs / applications that *make* sockets readable/writable by other people/users (a-la PHP, etc.) rather than run everything in home directory21:46
sdezielteward: that's the thing, `www-data` is a member of the `dev` group22:22
sdezielteward: and yeah, I am pretty sure the problem isn't the Python app22:22
sdezielfoo: I agree with teward's suggestion of putting the socket under `/run`. You can even tell systemd to create `/run/myapp-api` (`RuntimeDirectory=`) to contain the socket file22:25
=== arraybolt3_ is now known as arraybolt3
sdezielfoo: strace'ing the nginx child handling the request (the one getting a perm denied) might be useful22:31
sdezielprobably more useful than that debug log22:31
tewardsdeziel: i would not trust www-data being a member of the grou pas far as i can throw it22:36
tewardwhether the system says so or not22:36
tewardit's the *least* reliable mechanism to validate access22:36
teward(runtimedirectory=... is the better approach by *far*)22:36

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!