Waziup / WaziGate

Waziup LoRa Edge gateway
21 stars 20 forks source link

Update of wazigate-lora APP via GUI terminates existing LoRa links and does not allow re-establishing the links #149

Open SvenZeisberg opened 3 years ago

SvenZeisberg commented 3 years ago

After installing a fresh wazigate image v2.1.10 and connecting it succesfully to a wazidev and to the cloud ...and then updating the wazigate-lora app via the GUI the LoRa connection was not restored and could also not restored after a complete restart. The messages were still received by the forwarder, but the error log of waziup.wazigate-lora was showing following: 2021-03-11T00:43:48.617358038Z --- Init ChirpStack 2021-03-11T00:43:48.631499318Z Organization "chirpstack" OK. 2021-03-11T00:43:48.674805964Z Network-server "Local Chirpstack Network Server" OK. 2021-03-11T00:43:48.716889651Z Service-profile "Wazigate Service Profile" OK. 2021-03-11T00:43:48.733409816Z Gateway "LocalWazigate_0242ac1200023c9b" OK. 2021-03-11T00:43:48.743556341Z The ChirpStack data has not changed. 2021-03-11T00:43:48.743580195Z Err grpc: can not create application: rpc error: code = AlreadyExists desc = object already exists

SvenZeisberg commented 3 years ago

At the same time the postgresql log shows following error message:

2021-03-11T00:59:14.184271875Z ERROR: duplicate key value violates unique constraint "application_name_organization_id_key" 2021-03-11T00:59:14.839269303Z DETAIL: Key (name, organization_id)=(Wazigate, 1) already exists. 2021-03-11T00:59:14.839362896Z STATEMENT:
2021-03-11T00:59:14.839430500Z insert into application ( 2021-03-11T00:59:14.839497218Z name, 2021-03-11T00:59:14.839562946Z description, 2021-03-11T00:59:14.839627269Z organization_id, 2021-03-11T00:59:14.839693362Z service_profile_id, 2021-03-11T00:59:14.839756903Z payload_codec, 2021-03-11T00:59:14.839823569Z payload_encoder_script, 2021-03-11T00:59:14.839888048Z payload_decoder_script 2021-03-11T00:59:14.839954870Z ) values ($1, $2, $3, $4, $5, $6, $7) returning id

SvenZeisberg commented 3 years ago

Would be good, if some from the development team can confirm this CRITICAL BUG by +installing a fresh version from the v2.1.10 image, +install just one wazidev with one sensor

SvenZeisberg commented 3 years ago

Hi Moji, where this bug could be coming from? Is it due to the update procedure docker stop/start/config scheduling? Or is it due to missing some removal of some objects or at least not to try to create the same objects again if it is already there? For me this is a CRITICAL BUG, because ones you update the wazigate-lora app via the GUI (funny enough from 0.18.8 to 0.18.8???) you can not establish your running LoRa connections again and you can also not re-establish them. The only "bug around" I see right now is never updating the wazigate-lora ...but it is sooo seductive, if the update button is blinking orange ... ;)