Can't start on Ubuntu

I have Ubuntu 22.04 and I’m trying to start with this guide
https://www.chirpstack.io/docs/getting-started/debian-ubuntu.html
But when i almost finish it and type
sudo journalctl -f -n 100 -u chirpstack

I got a lot of messages and can’t exit unless i close the terminal.

Messages like this:

окт 04 14:40:28 Ubuntu chirpstack[37050]: Error: Setup PostgreSQL connection pool error
окт 04 14:40:28 Ubuntu chirpstack[37050]: Caused by:
окт 04 14:40:28 Ubuntu chirpstack[37050]:     timed out waiting for connection: FATAL:  password authentication failed for user "chirpstack"
окт 04 14:40:28 Ubuntu chirpstack[37050]:     
окт 04 14:40:28 Ubuntu systemd[1]: chirpstack.service: Main process exited, code=exited, status=1/FAILURE
окт 04 14:40:28 Ubuntu systemd[1]: chirpstack.service: Failed with result 'exit-code'.
окт 04 14:40:29 Ubuntu systemd[1]: chirpstack.service: Scheduled restart job, restart counter is at 80.
окт 04 14:40:29 Ubuntu systemd[1]: Stopped ChirpStack open-source LoRaWAN Network Server.
окт 04 14:40:29 Ubuntu systemd[1]: Started ChirpStack open-source LoRaWAN Network Server.
окт 04 14:40:29 Ubuntu chirpstack[37127]: 2023-10-04T09:40:29.142164Z  INFO chirpstack::cmd::root: Starting ChirpStack LoRaWAN Network Server version="4.5.0" docs="https://www.chirpstack.io/"
окт 04 14:40:29 Ubuntu chirpstack[37127]: 2023-10-04T09:40:29.142208Z  INFO chirpstack::storage: Setting up PostgreSQL connection pool

And the chirpstack is not working.

Also mosquitto seems to not working as well

vboxuser@Ubuntu:~$ sudo systemctl start mosquitto
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xeu mosquitto.service" for details.

Since it couldn’t authenticate with PostgreSQL, did you check that you have entered the same credentials that you created the “chirpstack” user with?

As for Mosquitto, you need to check the logs (through journalctl) to know what the problem is.

I only followed steps in the guide. so i guess i did it right.
As for mosquitto, here’s what logs says:

vboxuser@Ubuntu:~$ sudo journalctl -xeu mosquitto.service
[sudo] password for vboxuser: 
окт 04 16:06:44 Ubuntu systemd[1]: Stopped Mosquitto MQTT Broker.
░░ Subject: A stop job for unit mosquitto.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A stop job for unit mosquitto.service has finished.
░░ 
░░ The job identifier is 1241 and the job result is done.
окт 04 16:06:44 Ubuntu systemd[1]: mosquitto.service: Start request repeated to>
окт 04 16:06:44 Ubuntu systemd[1]: mosquitto.service: Failed with result 'exit->
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit mosquitto.service has entered the 'failed' state with result 'exit->
окт 04 16:06:44 Ubuntu systemd[1]: Failed to start Mosquitto MQTT Broker.
░░ Subject: A start job for unit mosquitto.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit mosquitto.service has finished with a failure.
░░ 
░░ The job identifier is 1241 and the job result is failed.

Could you please check your password?

Check that /etc/chirpstack/chirpstack.toml indicates the expected username and password. The line looks like this and shows the default chirpstack username and password.

dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable"

Assuming you used the default for Chirpstack, then you should check that you created the user under the “chirpstack” database.

psql (16.0)
Type "help" for help.

postgres=# \c chirpstack
You are now connected to database "chirpstack" as user "postgres".
chirpstack=# \du
                              List of roles
 Role name  |                         Attributes
------------+------------------------------------------------------------
 chirpstack |

chirpstack=#

If it looks good so far, re-enter the password, to eliminate the possibility that it was entered incorrectly:

chirpstack=# \password chirpstack
Enter new password for user "chirpstack":
Enter it again:

As for Mosquitto, I don’t really know how to help you as nothing is getting output. You can stop the service first, and start mosquitto directly:

sudo /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Fix the error, and then start it properly with systemctl.

In chirpstack.toml it looks like this
dsn="postgres://chirpstack:chirpstack@localhost/chirpstack?sslmode=disable"

And then i go:

vboxuser@Ubuntu:~$ sudo -u postgres psql
[sudo] password for vboxuser: 
psql (14.9 (Ubuntu 14.9-0ubuntu0.22.04.1))
Type "help" for help.

postgres=# \c chirpstack
You are now connected to database "chirpstack" as user "postgres".
chirpstack=# \du

And get:

                                   List of roles
 Role name  |                         Attributes                         | Member of 
------------+------------------------------------------------------------+-----------
 chirpstack |                                                            | {}
 postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

i re-entered password and re-started the chirpstack and got this in the logs:

окт 05 10:50:53 Ubuntu systemd[1]: Started ChirpStack open-source LoRaWAN Network Server.
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.647031Z  INFO chirpstack::cmd::root: Starting ChirpStack LoRaWAN Network Server version="4.5.0" docs="https://www.chirpstack.io/"
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.647104Z  INFO chirpstack::storage: Setting up PostgreSQL connection pool
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.709666Z  INFO chirpstack::storage: Applying schema migrations
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.711786Z  INFO chirpstack::storage: Setting up Redis client
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.718860Z  INFO chirpstack::region: Setting up regions
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.718950Z  INFO setup{common_name=CN779 region_id=cn779}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719056Z  WARN setup{common_name=US915 region_id=us915_4}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_4' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719085Z  WARN setup{common_name=CN470 region_id=cn470_5}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_5' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719110Z  WARN setup{common_name=CN470 region_id=cn470_7}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_7' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719136Z  WARN setup{common_name=CN470 region_id=cn470_0}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_0' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719161Z  INFO setup{common_name=IN865 region_id=in865}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719219Z  INFO setup{common_name=ISM2400 region_id=ism2400}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719264Z  WARN setup{common_name=CN470 region_id=cn470_6}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_6' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719289Z  INFO setup{common_name=US915 region_id=us915_0}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719478Z  WARN setup{common_name=CN470 region_id=cn470_9}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_9' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719505Z  WARN setup{common_name=CN470 region_id=cn470_1}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_1' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719529Z  INFO setup{common_name=AU915 region_id=au915_0}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719655Z  WARN setup{common_name=US915 region_id=us915_2}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_2' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719681Z  WARN setup{common_name=US915 region_id=us915_5}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_5' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719706Z  INFO setup{common_name=AS923_4 region_id=as923_4}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719758Z  WARN setup{common_name=AU915 region_id=au915_2}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_2' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719783Z  WARN setup{common_name=AU915 region_id=au915_4}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_4' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719809Z  INFO setup{common_name=RU864 region_id=ru864}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719862Z  WARN setup{common_name=CN470 region_id=cn470_3}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_3' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719887Z  WARN setup{common_name=US915 region_id=us915_3}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_3' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719913Z  WARN setup{common_name=AU915 region_id=au915_7}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_7' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.719938Z  INFO setup{common_name=AS923 region_id=as923}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720012Z  WARN setup{common_name=CN470 region_id=cn470_2}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_2' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720038Z  INFO setup{common_name=EU433 region_id=eu433}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720126Z  WARN setup{common_name=US915 region_id=us915_6}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_6' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720153Z  WARN setup{common_name=AU915 region_id=au915_3}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_3' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720179Z  WARN setup{common_name=US915 region_id=us915_7}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'us915_7' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720204Z  INFO setup{common_name=KR920 region_id=kr920}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720260Z  WARN setup{common_name=CN470 region_id=cn470_8}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_8' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720286Z  INFO setup{common_name=AS923_2 region_id=as923_2}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720336Z  INFO setup{common_name=CN470 region_id=cn470_10}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720466Z  WARN setup{common_name=AU915 region_id=au915_5}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_5' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720493Z  WARN setup{common_name=CN470 region_id=cn470_4}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_4' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720519Z  INFO setup{common_name=US915 region_id=us915_1}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720692Z  WARN setup{common_name=AU915 region_id=au915_1}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_1' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720718Z  WARN setup{common_name=AU915 region_id=au915_6}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'au915_6' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720744Z  WARN setup{common_name=CN470 region_id=cn470_11}: chirpstack::region: Config exists, but region is not enabled. To enable it, add 'cn470_11' to 'network.enabled_regions'
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720769Z  INFO setup{common_name=AS923_3 region_id=as923_3}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720819Z  INFO setup{common_name=EU868 region_id=eu868}: chirpstack::region: Configuring region
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720950Z  INFO chirpstack::backend::joinserver: Setting up Join Server clients
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720963Z  INFO chirpstack::backend::roaming: Setting up roaming clients
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.720975Z  INFO chirpstack::adr: Setting up adr algorithms
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.721023Z  INFO chirpstack::integration: Setting up global integrations
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.721035Z  INFO chirpstack::integration::redis: Initializing Redis integration
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.721048Z  INFO chirpstack::integration::mqtt: Initializing MQTT integration
окт 05 10:50:53 Ubuntu chirpstack[4948]: 2023-10-05T05:50:53.737935Z  INFO chirpstack::integration::mqtt: Connecting to MQTT broker server_uri=tcp://localhost:1883/ client_id=afe1127c901f36fb clean_session=false
окт 05 10:50:53 Ubuntu chirpstack[4948]: Error: Setup MQTT integration
окт 05 10:50:53 Ubuntu chirpstack[4948]: Caused by:
окт 05 10:50:53 Ubuntu chirpstack[4948]:     0: Connect to MQTT broker
окт 05 10:50:53 Ubuntu chirpstack[4948]:     1: [-1] TCP/TLS connect failure
окт 05 10:50:53 Ubuntu systemd[1]: chirpstack.service: Main process exited, code=exited, status=1/FAILURE
окт 05 10:50:53 Ubuntu systemd[1]: chirpstack.service: Failed with result 'exit-code'.
окт 05 10:50:54 Ubuntu systemd[1]: chirpstack.service: Scheduled restart job, restart counter is at 5.
окт 05 10:50:54 Ubuntu systemd[1]: Stopped ChirpStack open-source LoRaWAN Network Server.

It appears that you have solved the credentials problem with PostgreSQL. Congratulations!

Have you tried what I suggested above, for Mosquito? It is impossible to tell what is wrong, without any log messages.

Thank you so much for helping me! But still, i can’t start a chirpstack, it seems that the problem is only with mosquitto now.

Okay, here is what logs for Mosquitto says:

vboxuser@Ubuntu:~$ sudo systemctl status mosquitto
[sudo] password for vboxuser: 
× mosquitto.service - Mosquitto MQTT Broker
     Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor pre>
     Active: failed (Result: exit-code) since Fri 2023-10-06 09:29:29 +05; 7min>
       Docs: man:mosquitto.conf(5)
             man:mosquitto(8)
    Process: 797 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exi>
    Process: 798 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exi>
    Process: 799 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited,>
    Process: 802 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited,>
    Process: 803 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf>
   Main PID: 803 (code=exited, status=1/FAILURE)
        CPU: 29ms

окт 06 09:29:29 Ubuntu systemd[1]: mosquitto.service: Scheduled restart job, re>
окт 06 09:29:29 Ubuntu systemd[1]: Stopped Mosquitto MQTT Broker.
окт 06 09:29:29 Ubuntu systemd[1]: mosquitto.service: Start request repeated to>
окт 06 09:29:29 Ubuntu systemd[1]: mosquitto.service: Failed with result 'exit->
окт 06 09:29:29 Ubuntu systemd[1]: Failed to start Mosquitto MQTT Broker.
vboxuser@Ubuntu:~$ sudo systemctl start mosquitto
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xeu mosquitto.service" for details.
vboxuser@Ubuntu:~$ sudo journalctl -xeu mosquitto.service
окт 06 09:37:46 Ubuntu systemd[1]: Stopped Mosquitto MQTT Broker.
░░ Subject: A stop job for unit mosquitto.service has finished
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A stop job for unit mosquitto.service has finished.
░░ 
░░ The job identifier is 3292 and the job result is done.
окт 06 09:37:46 Ubuntu systemd[1]: mosquitto.service: Start request repeated to>
окт 06 09:37:46 Ubuntu systemd[1]: mosquitto.service: Failed with result 'exit->
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit mosquitto.service has entered the 'failed' state with result 'exit->
окт 06 09:37:46 Ubuntu systemd[1]: Failed to start Mosquitto MQTT Broker.
░░ Subject: A start job for unit mosquitto.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit mosquitto.service has finished with a failure.
░░ 
░░ The job identifier is 3292 and the job result is failed.

The problem is solved! I just installed mosquitto 2.0.18 (i had 2.0.11 somehow. i deleted it and installed 2.0.18).

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