helium / console

A management console to onboard and manage devices running on the Helium blockchain network.
Apache License 2.0
104 stars 31 forks source link

JSON device import failure #1102

Closed disk91 closed 2 years ago

disk91 commented 2 years ago
  1. Are you using Helium hosted Console or running your own open source Console? OSS console / Helium-iot.eu

  2. One of the user tried to import devices from helium console but this import failed. Here is the console log:


14:26:42.746 [info] POST /api/organizations/import
14:26:42.758 [info] Sent 500 in 11ms
14:26:42.759 [error] #PID<0.7397.0> running ConsoleWeb.Endpoint (connection #PID<0.7396.0>, stream id 1) terminated
Server: console.helium-iot.eu:80 (http)
Request: POST /api/organizations/import
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in ConsoleWeb.FallbackController.call/2
        (console 2.0.0) lib/console_web/controllers/fallback_controller.ex:9: ConsoleWeb.FallbackController.call(%Plug.Conn{adapter: {Plug.Cowboy.Conn, :...}, assigns: %{current_user: %Console.Auth.User{__meta__: #Ecto.Schema.Metadata<:built, "users">, api_keys: #Ecto.Association.NotLoaded<association :api_keys is not loaded>, confirmation_token: nil, confirmed_at: nil, email: "xxxxxxx", id: "did:ethr:0xD6xxxxxxxxx431b", inserted_at: nil, last_2fa_skipped_at: nil, memberships: #Ecto.Association.NotLoaded<association :memberships is not loaded>, organizations: #Ecto.Association.NotLoaded<association :organizations is not loaded>, password: nil, password_hash: nil, super: false, updated_at: nil}, email: "xxxxx", user_id: "did:ethr:0xD6xxxxxx2xxx431b"}, body_params: %{"_json" => "{\r\n  \"alert_nodes\": [],\r\n  \"alerts\": [],\r\n  \"channels\": [\r\n    {\r\n      \"credentials\": {\r\n        \"endpoint\": \"https://api.datacake.co/integrations/lorawan/helium/\",\r\n        \"headers\": {\r\n          \"Key\": \"Authentication\",\r\n          \"Value\": \"Token xxxxxxx\"\r\n        },\r\n        \"inbound_to
...
``` 
vicmgs commented 2 years ago

Can you show more of the error message?

Usually this happens if device credentials being imported already exist in the db.

disk91 commented 2 years ago

as this log is a temptative to reimport after a failure to get a log, it is possible that previsouly some elment has been created I don't have the previous log with the first import

Basically, the import feature from helium console to helium console is not working.

vicmgs commented 2 years ago

Did not understand your problem at all.

Do you have the import json that you are trying to import?

vicmgs commented 2 years ago

closing for now, will work with you next week to iron things out