0
I have a CI/CD in GitLab in an EC2 with Ubuntu 18.04. The directory where the folders current
and releases
are placed is /home/ubuntu/airflow_ci
. Every time I push a new version from my computer I receive an email with the following error:
| Clean up releases] ****
fatal: [IP]: FAILED! => {"changed": true, "cmd": "ls -1dt /home/ubuntu/airflow_ci/releases/* | tail -n +3 | xargs rm -rf", "delta": "0:00:00.006194", "end": "2019-10-10 09:23:15.162347", "failed": true, "rc": 123, "start": "2019-10-10 09:23:15.156153", "stderr": "rm: cannot remove '/home/ubuntu/airflow_ci/releases/20191008090731Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191008090731Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191008090731Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004124041Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004124041Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004124041Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004114145Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004114145Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004114145Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004105529Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004105529Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004105529Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004104415Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004104415Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004104415Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004102520Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004102520Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004101844Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004101844Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191004101844Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002171748Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002171748Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002171748Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002162725Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002162725Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002162725Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002144731Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002144731Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002144731Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002162125Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002162125Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove '/home/ubuntu/airflow_ci/releases/20191002162125Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002144442Z/dags/__pycache__/requests_emailage_data.cpython-37.pyc': Permission denied\nrm: cannot remove
'/home/ubuntu/airflow_ci/releases/20191002144442Z/dags/__pycache__/hello_world.cpython-37.pyc': Permission denied\nrm: cannot remove '/home/ubuntu/airflow_ci/releases/20191002144442Z/dags/__pycache__/retraining_sagemaker.cpython-37.pyc': Permission denied", "stdout": "", "stdout_lines": [], "warnings": []}
to retry, use: --limit @resources/deploy/deploy-master.retry
PLAY RECAP *********************************************************************
IP : ok=18 changed=6 unreachable=0 failed=1
ERROR: Job failed: exit code 1
I have tried with the following commands and none of them works:
sudo chown ubuntu airflow_ci
sudo chown ubuntu releases
sudo chmod 755 -R releases
sudo chmod 755 -R airflow_ci
sudo chmod -R a+rX * airflow_ci
sudo chmod -R a+rX * releases
This is the first machine in which I have this problem and I am totally lost. How could I solve it?
Thanks