Score:0

Permissions problem in Ubuntu when accessing airflow webserver as root and non-root user

in flag

I have followed this guide to install MySQL for aiflow on Ubuntu 22.04. https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04

I have created a non-root administrative user (myusername) who is able to do sudo commands and set up this user's password.

then I proceeded with installing airflow as this user.

Now one thing I notice is that my Python seems to be installed in a different directory from my airflow.

#python
myusername@LAPTOP-28BMMQV7:/root$ ls -l /usr/bin/python*
lrwxrwxrwx 1 root root      10 Aug 18 11:39 /usr/bin/python3 -> python3.10
lrwxrwxrwx 1 root root      17 Aug 18 11:39 /usr/bin/python3-config -> python3.10-config
-rwxr-xr-x 1 root root 5912936 Nov  2 18:53 /usr/bin/python3.10

#airflow
drwxrwxr-x 2 myusername myusername 4096 Nov 20 14:17 __pycache__
-rwxrwxr-x 1 myusername myusername 3472 Nov 20 14:17 activate-global-python-argcomplete
-rwxrwxr-x 1 myusername myusername  215 Nov 20 14:17 airflow
-rwxrwxr-x 1 myusername myusername  213 Nov 20 14:17 alembic

At first Ubuntu did recognize any airflow commands such as 'airflow info' and see my files with 'ls -l ~/.local/bin' until I have added 'PATH=$PATH:~/.local/bin' to the end of the ~/.bashrc file.

However, I am now having an error with opening a webserver with my non-root admin user:

myusername@LAPTOP-28BMMQV7:/root$ airflow webserver -p 8080

Error: [Errno 13] Permission denied: '/root'
[2022-11-20 18:11:05,198] {webserver_command.py:217} ERROR - No response from gunicorn master within 120 seconds
[2022-11-20 18:11:05,199] {webserver_command.py:218} ERROR - Shutting down webserver

In addition, I cant do 'myuserame@LAPTOP-28BMMQV7:/root$ cd airflow/' as it says:

bash: cd: airflow/: Permission denied

When I try to switch to root with 'su root' it is asking me for a password which I do not know (I have probably reset this password when altering'root'@'localhost' IDENTIFIED WITH auth_socket).

Can someone help me with this? I'm not v experienced with Ubuntu and have it installed on WSL2.

in flag
Which `root` are you referring to? The root account of the server or the root account for MySQL? The MySQL `root` account *cannot* be used by applications.
Bluetail avatar
in flag
it is the root which appears when I open up Ubuntu. I can see 'root@LAPTOP-28BMMQV7:~#', and from that I switch to 'su myusername'.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.