Geek Logbook

Tech sea log book

PostgreSQL on Windows – server error 500 – Ports are not available

I made a mistake the first time when I installed PostgreSQL: I installed it locally. It wouldn’t be a problem if I weren’t planning to use Docker, but as I want to develop a project in Apache Airflow.

To install Postgres, I went to the Postgres webpage and selected the window installer option: Windows installers option. It works ok for database, queries and whatever things related to a relational database.

After that I decided to install Apache Airflow using Astronomer as you can see in this post: ASTRONOMER: Install on Windows

Problems About the ports

Once instaled both, postgres locally and Astronomer when i tried to run the process i found the following problem:

Error invoking remote method ‘docker-start-container’: Error: (HTTP code 500) server error – Ports are not available: exposing port TCP -> listen tcp bind: An attempt was made to access a socket in a way forbidden by its access permissions.

And this happens because the Postgres port is being used by the Postgres I’ve installed locally. You can see it if you can see the services.msc. As you can read by yourself in this Stack overflow thread: PostgreSQL database service

A solution: not the most elegant but a solution at last

If you stop this service, you will run the Postgres service in Docker, and then, finally run Apache Airflow:

Airflow working


Leave a Reply

Your email address will not be published. Required fields are marked *.

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>