gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
946 stars 327 forks source link

dbimport Connection refused #254

Closed hallard closed 6 years ago

hallard commented 6 years ago

Hi, I've done a dbexport from one server (PI+ Ic880A) and do the dbimport to another one (Pi Zero + RAK831) and on import I got some error messages

/usr/lib/lorawan-server/bin $ sudo ./dbimport backup-20171207-140857/
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:45 URL:http://localhost:8080/connectors [0] -> "connectors" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:45 URL:http://localhost:8080/devices [0] -> "devices" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:45 URL:http://localhost:8080/gateways [0] -> "gateways" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:46 URL:http://localhost:8080/handlers [0] -> "handlers" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:46 URL:http://localhost:8080/ignored_nodes [0] -> "ignored_nodes" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:46 URL:http://localhost:8080/multicast_channels [0] -> "multicast_channels" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:46 URL:http://localhost:8080/nodes [0] -> "nodes" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:30:46 URL:http://localhost:8080/users [0] -> "users" [1]

Everything looks imported (gateway, nodes, connectors, ...) but I'm wondering why I've got these error messages? When I done this one same server (to restore) I didn't had any errors of course both servers have same default credentials admin/admin.

Humm on this server 0.4.13 even dbexport fire error message, but export is done

$ sudo ./dbexport
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/users [84/84] -> "backup-20171213-123952/users.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/gateways [494/494] -> "backup-20171213-123952/gateways.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/multicast_channels [2/2] -> "backup-20171213-123952/multicast_channels.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/devices [1242/1242] -> "backup-20171213-123952/devices.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/nodes [2726/2726] -> "backup-20171213-123952/nodes.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/ignored_nodes [2/2] -> "backup-20171213-123952/ignored_nodes.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/handlers [76/76] -> "backup-20171213-123952/handlers.json" [1]
failed: Connection refused.
Authentication selected: Basic realm="lorawan-server"
2017-12-13 12:39:52 URL:http://localhost:8080/connectors [140/140] -> "backup-20171213-123952/connectors.json" [1]
$ ls 
total 48
drwxr-xr-x 2 root root 4096 Dec  7 13:59 backup-20171207-135427
drwxr-xr-x 2 root root 4096 Dec  7 14:08 backup-20171207-140857
drwxr-xr-x 2 root root 4096 Dec 13 12:39 backup-20171213-123952
-rwxr-xr-x 1 root root  296 Nov  3 21:56 dbexport
-rwxr-xr-x 1 root root  266 Nov  3 21:56 dbimport
-rwxr-xr-x 1 root root  347 Nov  3 21:56 lorawanctl
-rwxr-xr-x 1 root root  928 Nov  3 21:56 lorawan-server
-rw-r--r-- 1 root root  574 Nov  3 21:56 lorawan-server.bat
-rw-r--r-- 1 root root  337 Nov  3 21:56 lorawan-server.service
-rw-r--r-- 1 root root  778 Nov  3 21:56 lorawan-service.bat
-rw-r--r-- 1 root root 5511 Nov  3 21:57 start_clean.boot
gotthardp commented 6 years ago

Hmmm. I saw similar messages and I thought it's caused by the HTTP authentication procedure (where the first request is rejected with a request for credentials). However, I agree the message is confusing. I will keep this issue open and try to avoid this issue.

hallard commented 6 years ago

Makes sense, I tried at first time to pass credential on command line but did not found how to and even if it's possible.

altishchenko commented 6 years ago

This is unfortunate curl 'feature'.