Lucas David
Lucas David

Reputation: 21

psycopg2.OperationalError FATAL: role "ubuntu" does not exist

I'm on windows and i installed ubuntu terminal, this is what i'm doing: https://medium.com/@ryanroline/installing-apache-airflow-on-windows-10-5247aa1249ef

When i run airflow initdb i get this error:

Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 37, in <module>
    ...
  File "/home/lucas/.local/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL:  role "ubuntu" does not exist

But i did create profile and assign the correct privileges:

CREATE ROLE ubuntu;
CREATE DATABASE airflow;
GRANT ALL PRIVILEGES on database airflow to ubuntu;
ALTER ROLE ubuntu SUPERUSER;
ALTER ROLE ubuntu CREATEDB; 
ALTER ROLE ubuntu LOGIN;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public to ubuntu;

I don't know why it keeps getting this error.

Upvotes: 0

Views: 1957

Answers (1)

Lucas David
Lucas David

Reputation: 21

I fix it, in the postgres configuration i have port 5433 and in airflow configuration i had 5432.

Upvotes: 1

Related Questions