Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error pq: relation "gateway" does not exist (code: 2) #55

Closed
simonnilsson opened this issue Mar 30, 2017 · 6 comments
Closed

Error pq: relation "gateway" does not exist (code: 2) #55

simonnilsson opened this issue Mar 30, 2017 · 6 comments

Comments

@simonnilsson
Copy link

After upgrading loraserver to 0.16.1 and lora-app-server to 0.7.0 i get the following error on the "Manage Gateway" page, it appears like the gateway table in the database is not created correctly in the migration.

Error pq: relation "gateway" does not exist (code: 2)

@brocaar
Copy link
Owner

brocaar commented Mar 30, 2017

Please see the --db-automigrate / DB_AUTOMIGRATE config setting, which will create all tables.

@simonnilsson
Copy link
Author

Hi, thanks for a quick response. I have that option enabled in the configuration and have also tried running it manually.

INFO[0000] starting LoRa App Server                      docs="https://docs.loraserver.io/" version=0.7.0
INFO[0000] connecting to postgresql
INFO[0000] setup redis connection pool
INFO[0000] handler/mqtt: connecting to mqtt broker       server="tcp://localhost:1883"
INFO[0000] connecting to network-server api              ca-cert= server="127.0.0.1:8000" tls-cert= tls-key=
INFO[0000] applying database migrations
INFO[0000] handler/mqtt: connected to mqtt broker
INFO[0000] handler/mqtt: subscribling to tx topic        topic="application/+/node/+/tx"
INFO[0000] migrations applied                            count=0
INFO[0000] starting application-server api               bind="0.0.0.0:8001" ca-cert= tls-cert= tls-key=

@brocaar
Copy link
Owner

brocaar commented Mar 30, 2017

Sorry, I meant you need to add that config setting to the LoRa Server config (as LoRa Server will keep track of your gateways and stats).

@simonnilsson
Copy link
Author

simonnilsson commented Mar 30, 2017

Okay, I have enabled it in the loraserver configuration as well, but same result unfortunately.

level=info msg="applying database migrations"
level=info msg="migrations applied" count=0"

@brocaar
Copy link
Owner

brocaar commented Mar 30, 2017

Would you mind sending me a private message on https://gitter.im/loraserver/loraserver, then we can together go over your config and see if it is a config issue or if there is a bug somewhere.

@simonnilsson
Copy link
Author

The problem was that I used the same database for both loraserver and lora-app-server, changing loraserver to its own database solved the problem, thanks @brocaar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants