3

Following the AWS MWAA (Amazon Managed Workflows for Apache Airflow) installation tutorial for Windows using Docker in WSL (Windows Subsystem for Linux) 2 with Ubuntu distro, I encountered a problem when trying to run a local Apache Airflow environment.

When I input the command wsl ./mwaa-local-env start, this is the output:

docker-postgres-1      | chmod: /var/lib/postgresql/data: Operation not permitted
docker-postgres-1      | The files belonging to this database system will be owned by user "postgres".
docker-postgres-1      | This user must also own the server process.
docker-postgres-1      |
docker-postgres-1      | The database cluster will be initialized with locale "en_US.utf8".
docker-postgres-1      | The default database encoding has accordingly been set to "UTF8".
docker-postgres-1      | The default text search configuration will be set to "english".
docker-postgres-1      |
docker-postgres-1      | Data page checksums are disabled.
docker-postgres-1      |
docker-postgres-1      | fixing permissions on existing directory /var/lib/postgresql/data ... initdb: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted
docker-postgres-1 exited with code 1
docker-local-runner-1  | Sat Feb 12 21:14:01 UTC 2022 - waiting for Postgres... 1/20
docker-local-runner-1  | Sat Feb 12 21:14:26 UTC 2022 - waiting for Postgres... 2/20
docker-local-runner-1  | Sat Feb 12 21:14:51 UTC 2022 - waiting for Postgres... 3/20
docker-local-runner-1  | Sat Feb 12 21:15:16 UTC 2022 - waiting for Postgres... 4/20
docker-local-runner-1  | Sat Feb 12 21:15:41 UTC 2022 - waiting for Postgres... 5/20
docker-local-runner-1  | Sat Feb 12 21:16:06 UTC 2022 - waiting for Postgres... 6/20
docker-local-runner-1  | Sat Feb 12 21:16:32 UTC 2022 - waiting for Postgres... 7/20
docker-local-runner-1  | Sat Feb 12 21:16:57 UTC 2022 - waiting for Postgres... 8/20
docker-local-runner-1  | Sat Feb 12 21:17:22 UTC 2022 - waiting for Postgres... 9/20
docker-local-runner-1  | Sat Feb 12 21:17:47 UTC 2022 - waiting for Postgres... 10/20
docker-local-runner-1  | Sat Feb 12 21:18:12 UTC 2022 - waiting for Postgres... 11/20
docker-local-runner-1  | Sat Feb 12 21:18:37 UTC 2022 - waiting for Postgres... 12/20
docker-local-runner-1  | Sat Feb 12 21:19:03 UTC 2022 - waiting for Postgres... 13/20
docker-local-runner-1  | Sat Feb 12 21:19:28 UTC 2022 - waiting for Postgres... 14/20
docker-local-runner-1  | Sat Feb 12 21:19:53 UTC 2022 - waiting for Postgres... 15/20
docker-local-runner-1  | Sat Feb 12 21:20:19 UTC 2022 - waiting for Postgres... 16/20
docker-local-runner-1  | Sat Feb 12 21:20:44 UTC 2022 - waiting for Postgres... 17/20
docker-local-runner-1  | Sat Feb 12 21:21:09 UTC 2022 - waiting for Postgres... 18/20
docker-local-runner-1  | Sat Feb 12 21:21:34 UTC 2022 - waiting for Postgres... 19/20
docker-local-runner-1  | Sat Feb 12 21:21:59 UTC 2022 - postgres:5432 still not reachable, giving up
docker-local-runner-1 exited with code 1
Stan Lyons
  • 71
  • 5
  • 2
    Have you looked this ? https://github.com/aws/aws-mwaa-local-runner/issues/45 it's not the same error but it might be related. – Oguzhan Aygun Feb 13 '22 at 03:33
  • 1
    @OguzhanAygun Interestingly enough, that actually did achieved desired result (his step 1 and step 2 worked). I will have to check with seniors as to why and how but Airflow is definitely running now. – Stan Lyons Feb 13 '22 at 16:57
  • Probably not the proper solution since there further error occurred down the road. But I switched to v.2.0.2 and it's no longer the problem. (See: https://github.com/aws/aws-mwaa-local-runner/branches) – Stan Lyons Feb 14 '22 at 14:55
  • Well... just for the record, it still remains a problem even with v.2.0.2 solution. – Stan Lyons Feb 14 '22 at 21:43

1 Answers1

1

This solution fixed it for me:

  1. docker volume create --name=db-data to create a db-data volume in docker

  2. In file ./docker/docker-compose-local.yml change the line

    - "${PWD}/db-data:/var/lib/postgresql/data"

    to

    - "/db-data:/var/lib/postgresql/data"

Credits to : https://github.com/aws/aws-mwaa-local-runner/issues/45

A H
  • 2,164
  • 1
  • 21
  • 36