Cannot get chirpstack application server running

Hello everybody,

trying to get chirpstack application server running.
git clone https://github.com/brocaar/chirpstack-application-server
cd chirpstack-application-server
docker-compose up --build

then
docker-compose run --rm chirpstack-application-server bash
make dev-requirements ui-requirements
make clean
make build

./build/chirpstack-application-server and in different terminal
cd ui
npm start

Nothing comes up in the opened browser page and this error message comes:
Proxy error: Could not proxy request /swagger/application.swagger.json from localhost:3000 to http://localhost:8080/.
See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).

The TOML file is in the root folder.
Any idea what is happening?

Best regards,
Yannick

Hi Yannick,
I’m not sure if it should work by starting npm in ui folder. When you do make clean / make build you should have an appserver executable in build folder. That executable includes webserver with ui.

Hi Martin,

thanks for the reply. Yes I see the executable. How would I start it?

followed this approach How to run the project development LoraServer on localhost?

followed this approach How to run the project development LoraServer on localhost?

So it could work. Idk, I did not try, or maybe I did but it didn’t work, so I skipped that as I did not really need a debug environment for minor changes I was doing. It would be better though. But first you should make sure you can build and run it in basic setup without changes.

I see the executable. How would I start it?

Well, that would depend on your operating system. The default binary is linux-amd64 I believe.

As I was on ubuntu I simply installed all chirpstack components and requirements on the system directly and used docker image only for app server source code build. Then I just swapped original binary for my built binary to run it with my configuration.

But basic way to build and run chirpstack components is using docker images I think.

Hi,

thanks. Yes but we would not want to build and run all components if we want only to change things on the application server?
Like add a button etc. in a development environment.
Could not get this to run yet.

Best regards,
Yannick

Then build just the application server. It seems to me thet you may be miissing the fact that application server web UI is part of application server binary (executable). Therefore, if you want to make changes in web UI then you have to build application server binary.

For other components you can just use pre-built binaries or docker images.

Although you do need to run the chirpstack-application-server binary, you can run the UI as a separate instance for testing.

cd ui
npm start

This will open your browser for http://localhost:3000. This server will reload on every change made to the .js code :slight_smile:

1 Like

That would be great for testing, I have to try it.

Ok, so if I do understand correctly, this won’t work using docker build container.

So far this works for me only if I sudo apt install npm on host machine so that I can run it on host too, not inside container. That way it works as @brocaar and @iegomez mentioned.

You can follow that approach even within containers. However, you will have to do some additional configurations to get everything up and running.

My suggestion in this case would be try to install and deploy from local and after a while, then move to the container approach, at that time you will be more familiar and the transition would be way easier.

1 Like

However, you will have to do some additional configurations to get everything up and running.

I’m interested what kind of config that would be because using docker container as build environment actually seems somehow easier and safer to me as it is pre-configured, so that I don’t really have to care about what packages of what versions to install.

First thing I’m thinking of is whether the ECONNREFUSED error is because of docker config rather than node.js config… ?

1 Like

That message appears probably because of the following:

  • missing ChirpStack Application Server binary running
  • even though when you have ChirpStack Application Server binary running, it may happen that you have not connected to the postgres database, hence the development server can not access the API at 8080/api.

You need to be sure that you are running the same container for both the binary and the development server. From the steps provided here, it looks to me that there are two different containers (one executing npm start, the other ChirpStack Application Server binary) that are not communicating each other. Aside of this, you need to make sure that the container that runs ChirpStack Application Server is able to reach the postgres database.

2 Likes