Unable to add new Gateway - since it "already exists"

I just finished installing a new server via the ansible scripts into an AWS instance, so I should have the latest version of everything.
The installation seemed to go well - I was able to reach it via https and login.

I jumped through the prerequisite hoops to remove the warning about needing a Network Server when attempting to add a Gateway.

I am now unable to add my gateway, since if I use it’s correct EUI - I get a "Error: object already exists (code: 2).

This is puzzling, since the Gateways list is EMPTY - I haven’t added any yet!

I did try adding one using a bogus EUI - and it was accepted, so I then deleted it - and then tried re-adding one using the correct EUI again, and received the same error code.

Any ideas?

That is odd, would you be able to send me a dump of your db in private so I can investigate?

I faced the same problem. I find that if the packet forwarder is running, a gateway will be automatically added to gateway table in PostgreSQL loraserver_ns database. This will cause error of “gateway already exists” when trying to add the gateway with the same MAC from web interface.
To fix the issue, stop the packet forwarder, delete the gateway from loraserver_ns table, and add the gateway from the web interface again.

Ah, by packet forwarder - you mean the Gateway - I assume. I probably DID have the Gateway pointing at the server instance in advance, which normally wouldn’t cause any issues except some errors in the logs…

This was a regression introduced by the gateway-profile refactor. I cleaned up some gateway related code, but forgot an error-code mapping (which should already have been there). Therefore the API returned an unknown error. Note that in this case the gateway already existed in the LoRa Server database. See:

I’m wondering why these “auto-registered” gateways are (currently) not showing under der “Gateways” tab. Managing three gateways pointing at my loraserver I also ran into this non-intuitive “already exists” problem after a fresh install. Removing these “hidden” gateway entries from the ns database helped. Since two gateways are mounted outdoors well out of reach, I had to temporarily disable the gateway-bridge to get them fully pre-registered under the Gateways tab…

This has been fixed, but not yet released. The reason why these gateways don’t automatically show up is that the system doesn’t know to which organization it would below. However, when they are automatically created, LoRa Server will already start collecting statistics. Also in case you would not use LoRa App Server but your own application-server, this feature could be useful :slight_smile:

I just ran into this problem today as well.

When you pull the latest LoRa Server version (0.26.1), this issue should be fixed :slight_smile:

Indeed, the issue is fixed! Thank you :slight_smile: