-1

I created a venv for airflow on Ubuntu and copy this venv to another Ubuntu that doesn't have internet. Now when airflow scheduler run shows permission denied to airflow Airflow webserver runs without any problem how I should solve this?

I use chmod -R 777 for venv but problem is exist

1 Answers1

0

Ensure the copied venv has the correct ownership

sudo chown -R <username>:<username> /path/to/venv

Verify that the necessary executable permissions are set

chmod +x /path/to/venv/bin/airflow
chmod +x /path/to/venv/bin/airflow-scheduler

Restart the Airflow scheduler to apply the new permissions and configuration

/path/to/venv/bin/airflow scheduler

Edit

I realize now you are moving venv directly. If the systems have different architectures, dependencies or other environment variables. This is usually not the recommended way to move Python environments between systems. If you need to move your venv:

1. Create a requirements.txt file on the source system. This will create a requirements.txt file in your current directory, which lists all of the Python packages installed in the current virtual environment. pip freeze > requirements.txt

2. Transfer the requirements.txt file to the target system

3. Create a new venv and install dependencies on the target system

python3 -m venv myenv
source myenv/bin/activate
pip install -r requirements.txt
Alperen Tahta
  • 459
  • 2
  • 12
  • I grant chmod -R 777 . to all folder on venv so venv has full access – Sajad Rahbari May 28 '23 at 12:34
  • While chmod -R 777 sets the permissions so anyone can read, write, and execute, it doesn't change the file's owner or group. If Airflow is running under a certain user, and that user doesn't own the files or isn't in the file's group, it might still be denied permission. Please try my commands and if it works ping here – Alperen Tahta May 29 '23 at 07:21