Could not send request (Error: connect ECONNREFUSED)

I want to build a SensorThings API service and just installed postgreSQL in Linux (Ubuntu16.04.7).

I POST my request but got these messages:

What is the solution of the problem? I’ve asked chatgpt and and then got these feedbacks:

but since I am a really new man in the feild, I don’t know how to do specifically…
If anybody can give me the solution as clear as possible, I will be very very gratitude.
(Chinese is available, THX)

Hi @research-geoscient19 !

Thanks for reaching out about this and welcome to the community! :slight_smile:

So breaking down the responses you got,

  1. Server Not Running: The most common cause of this error is that there isn’t any server running on port 8080.

    • To troubleshoot this, run something like sudo netstat -tuln | grep 8080 in your terminal. This will show if there’s any process listening on port 8080. If nothing is returned, then there’s no process listening on that port, and you need to start your SensorThings API service.
    • If you’re using a specific software or server for the SensorThings API, make sure it’s running. If it’s already running, try restarting it.
  2. Wrong IP/Port Configuration: If the server is set to listen on a different IP or port, you would face this issue. Ensure the server is configured to listen on the desired IP and port.

    • Review the documentation for the SensorThings API service to find and edit the configuration files or settings of your instance to ensure it’s set to listen on or on port 8080.
  3. Firewall Restrictions: Sometimes, local firewall settings might block certain ports. Make sure that port 8080 is allowed in your firewall settings.

    • Check if the firewall is blocking the port: sudo ufw status.
    • If port 8080 is not allowed, you can allow it using: sudo ufw allow 8080.

Additionally, checking logs of the service you’re trying to run can provide clues or specific errors that are causing problems. Be sure that all dependencies and configurations needed for the SensorThings API service are properly installed and set up. Since you mentioned PostgreSQL, ensure that your SensorThings API service is able to connect to the PostgreSQL database. A failure in database connectivity can sometimes prevent the server from starting.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.