title: Airflow-Docker: PermissionError: [Errno 13] Permission denied: '<project directory>'
body: <p>Trying to run airflow using docker in my windows laptop. But I'm having an error (as seen below). The error displaying in the log of my dag is saying that there is a:
  -- PermissionError: [Errno 13] Permission denied: '../spotify_project'.</p>
  <p>Note: also attached is the structure of my project file</p>
  <p>What is the possible reason and work around for it? Thanks in advance</p>
  <p><a href="https://i.stack.imgur.com/UVu25.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UVu25.png" alt="enter image description here" /></a></p>
  <pre><code>*** Reading local file: /opt/airflow/logs/dag_id=spotify_dag/run_id=scheduled__2022-06-04T00:00:00+00:00/task_id=run_spotify_etl/attempt=19.log
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1160} INFO - Dependencies all met for &lt;TaskInstance: spotify_dag.run_spotify_etl scheduled__2022-06-04T00:00:00+00:00 [queued]&gt;
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1160} INFO - Dependencies all met for &lt;TaskInstance: spotify_dag.run_spotify_etl scheduled__2022-06-04T00:00:00+00:00 [queued]&gt;
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1357} INFO - 
  --------------------------------------------------------------------------------
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1358} INFO - Starting attempt 19 of 24
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1359} INFO - 
  --------------------------------------------------------------------------------
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1378} INFO - Executing &lt;Task(PythonOperator): run_spotify_etl&gt; on 2022-06-04 00:00:00+00:00
  [2022-06-05, 23:21:12 UTC] {standard_task_runner.py:52} INFO - Started process 8522 to run task
  [2022-06-05, 23:21:12 UTC] {standard_task_runner.py:79} INFO - Running: ['***', 'tasks', 'run', 'spotify_dag', 'run_spotify_etl', 'scheduled__2022-06-04T00:00:00+00:00', '--job-id', '77', '--raw', '--subdir', 'DAGS_FOLDER/spotify_dags.py', '--cfg-path', '/tmp/tmpfaha58h3', '--error-file', '/tmp/tmpqi0j7yi6']
  [2022-06-05, 23:21:12 UTC] {standard_task_runner.py:80} INFO - Job 77: Subtask run_spotify_etl
  [2022-06-05, 23:21:12 UTC] {task_command.py:370} INFO - Running &lt;TaskInstance: spotify_dag.run_spotify_etl scheduled__2022-06-04T00:00:00+00:00 [running]&gt; on host 93b139943859
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1572} INFO - Exporting the following env vars:
  AIRFLOW_CTX_DAG_EMAIL=***@example.com
  AIRFLOW_CTX_DAG_OWNER=***
  AIRFLOW_CTX_DAG_ID=spotify_dag
  AIRFLOW_CTX_TASK_ID=run_spotify_etl
  AIRFLOW_CTX_EXECUTION_DATE=2022-06-04T00:00:00+00:00
  AIRFLOW_CTX_TRY_NUMBER=19
  AIRFLOW_CTX_DAG_RUN_ID=scheduled__2022-06-04T00:00:00+00:00
  [2022-06-05, 23:21:12 UTC] {logging_mixin.py:115} INFO - ...Refreshing Token...
  [2022-06-05, 23:21:12 UTC] {logging_mixin.py:115} INFO - Refresh token has been successfully retrieved.
  [2022-06-05, 23:21:12 UTC] {logging_mixin.py:115} INFO - ...Extracting spotify data from '2022-06-04 00:00:00'...
  [2022-06-05, 23:21:12 UTC] {logging_mixin.py:115} INFO - ...Connect to Spotify and establish GET Requests for 2022-06-04 00:00:00...
  [2022-06-05, 23:21:12 UTC] {logging_mixin.py:115} INFO - GET request from Spotify API is successful: https://api.spotify.com/v1/me/player/recently-played
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1890} ERROR - Task failed with exception
  Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.7/pathlib.py&quot;, line 1273, in mkdir
      self._accessor.mkdir(self, mode)
  FileNotFoundError: [Errno 2] No such file or directory: '../spotify_project/output_data/history_json_raw'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.7/pathlib.py&quot;, line 1273, in mkdir
      self._accessor.mkdir(self, mode)
  FileNotFoundError: [Errno 2] No such file or directory: '../spotify_project/output_data'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/home/airflow/.local/lib/python3.7/site-packages/airflow/operators/python.py&quot;, line 171, in execute
      return_value = self.execute_callable()
    File &quot;/home/airflow/.local/lib/python3.7/site-packages/airflow/operators/python.py&quot;, line 189, in execute_callable
      return self.python_callable(*self.op_args, **self.op_kwargs)
    File &quot;/opt/airflow/dags/run_spotify_etl.py&quot;, line 219, in call_spotify_etl
      a.call_refresh()
    File &quot;/opt/airflow/dags/run_spotify_etl.py&quot;, line 214, in call_refresh
      self.retrieve_recentlyplayed()
    File &quot;/opt/airflow/dags/run_spotify_etl.py&quot;, line 118, in retrieve_recentlyplayed
      Path(&quot;../spotify_project/output_data/history_json_raw&quot;).mkdir(parents=True, exist_ok=True)
    File &quot;/usr/local/lib/python3.7/pathlib.py&quot;, line 1277, in mkdir
      self.parent.mkdir(parents=True, exist_ok=True)
    File &quot;/usr/local/lib/python3.7/pathlib.py&quot;, line 1277, in mkdir
      self.parent.mkdir(parents=True, exist_ok=True)
    File &quot;/usr/local/lib/python3.7/pathlib.py&quot;, line 1273, in mkdir
      self._accessor.mkdir(self, mode)
  PermissionError: [Errno 13] Permission denied: '../spotify_project'
  [2022-06-05, 23:21:12 UTC] {taskinstance.py:1401} INFO - Marking task as UP_FOR_RETRY. dag_id=spotify_dag, task_id=run_spotify_etl, execution_date=20220604T000000, start_date=20220605T232112, end_date=20220605T232112
  [2022-06-05, 23:21:12 UTC] {standard_task_runner.py:97} ERROR - Failed to execute job 77 for task run_spotify_etl ([Errno 13] Permission denied: '../spotify_project'; 8522)
  [2022-06-05, 23:21:12 UTC] {local_task_job.py:156} INFO - Task exited with return code 1
  [2022-06-05, 23:21:13 UTC] {local_task_job.py:273} INFO - 0 downstream tasks scheduled from follow-on schedule check
  </code></pre>