Error context deadline exceeded

Hi,

I get the same error when I try to submit the certificates ca, tls and tls.key via the browser UI. The following error is shown in the log file.

time=“2018-03-25T16:59:35+02:00” level=error msg=“finished unary call with code Unknown” error=“rpc error: code = Unknown desc = context deadline exceeded” grpc.code=Unknown grpc.method=Update grpc.service=api.NetworkServer grpc.start_time=“2018-03-25T16:59:34+02:00” grpc.time_ms=507.354 peer.address="[::1]:39304" span.kind=server system=grpc

In get the additional warning before that:

time=“2018-03-25T17:31:51+02:00” level=info msg=“creating network-server client” server=“localhost:8000”
time=“2018-03-25T17:31:51+02:00” level=warning msg=“Failed to dial localhost:8000: connection error: desc = “transport: authentication handshake failed: tls: first record does not look like a TLS handshake”; please retry.”

but the server is running on port 8000. I am not sure how to debug the handshake. I just set the server up and I did it without the optional certificats so it should not have a handshake yet or am I wrong? I am currently trying to implement them though.

I fixed my error by applying the same thing as in this issue OtherIssue and the infos from the documentation.

I am getting this error attempting to add a Network-Server to a brand new LoRa Server install I spun up on a remote AWS Instance using the Ansible loraserver-setup project.
The server seemed to have installed w/out a problem - and will not allow me to create a Network-Server - so I am unable to even attempt to add anything else.

This may be similar to the issue I posted earlier today where I am unable to add a particular Gateway EUI due to the code 2 error on that setup: “Error: object already exists (code: 2)”

Please check that LoRa Server is actually running and can be connected to using the hostname:port you are entering.

I am having the same problem. All the services are up and running and I also just did a server reboot.

These are the logs I’m seeing on the node where I’m running both lora server and lora app server via docker:

time=“2019-04-25T22:32:41Z” level=warning msg=“creating insecure network-server client” server=“localhost:8000”
time=“2019-04-25T22:32:41Z” level=warning msg=“grpc: addrConn.createTransport failed to connect to {localhost:8000 0 }. Err :connection error: desc = “transport: Error while dialing dial tcp 127.0.0.1:8000: connect: connection refused”. Reconnecting…”
time=“2019-04-25T22:32:41Z” level=error msg=“finished unary call with code Unknown” error=“rpc error: code = Unknown desc = context deadline exceeded” grpc.code=Unknown grpc.method=Create grpc.service=api.NetworkServerService grpc.start_time=“2019-04-25T22:32:41Z” grpc.time_ms=505.798 peer.address=“127.0.0.1:47472” span.kind=server system=grpc
time=“2019-04-25T22:32:49Z” level=warning msg=“creating insecure network-server client” server=“localhost:8000”
time=“2019-04-25T22:32:49Z” level=warning msg=“grpc: addrConn.createTransport failed to connect to {localhost:8000 0 }. Err :connection error: desc = “transport: Error while dialing dial tcp 127.0.0.1:8000: connect: connection refused”. Reconnecting…”
time=“2019-04-25T22:32:49Z” level=error msg=“finished unary call with code Unknown” error=“rpc error: code = Unknown desc = context deadline exceeded” grpc.code=Unknown grpc.method=Create grpc.service=api.NetworkServerService grpc.start_time=“2019-04-25T22:32:49Z” grpc.time_ms=506.175 peer.address=“127.0.0.1:47472” span.kind=server system=grpc
time=“2019-04-25T22:32:53Z” level=warning msg=“creating insecure network-server client” server=“localhost:8000”
time=“2019-04-25T22:32:53Z” level=warning msg=“grpc: addrConn.createTransport failed to connect to {localhost:8000 0 }. Err :connection error: desc = “transport: Error while dialing dial tcp 127.0.0.1:8000: connect: connection refused”. Reconnecting…”
time=“2019-04-25T22:32:54Z” level=error msg=“finished unary call with code Unknown” error=“rpc error: code = Unknown desc = context deadline exceeded” grpc.code=Unknown grpc.method=Create grpc.service=api.NetworkServerService grpc.start_time=“2019-04-25T22:32:53Z” grpc.time_ms=505.574 peer.address=“127.0.0.1:47472” span.kind=server system=grpc
time=“2019-04-25T22:32:57Z” level=warning msg=“creating insecure network-server client” server=“localhost:8000”
time=“2019-04-25T22:32:57Z” level=warning msg=“grpc: addrConn.createTransport failed to connect to {localhost:8000 0 }. Err :connection error: desc = “transport: Error while dialing dial tcp 127.0.0.1:8000: connect: connection refused”. Reconnecting…”

Have you followed these instructions? GitHub - chirpstack/chirpstack-docker: Setup ChirpStack using Docker Compose

When adding the network-server in the LoRa App Server web-interface (see network-servers), you must enter loraserver:8000 as the network-server hostname:IP .

1 Like

Thanks @brocaar that fixed it!

Need Help

i install using docker app running and i can access it

but i got this error context deadline exceeded (code: 2) when i create network server

how to fix it

Ah i see, it was loraserver:8000, not localhost:8000, that’s why always failed to add :joy::joy:

Hi! Good afternoon, I installed loraserver on MV with Debian, but I can’t add Network-server. The error is appearing: context deadline exceeded (code 2). Can someone help me please?

Ja tentei usar :
Network-server name:

localhost
IP

Network-server server:

localhost:8080 ;
chirpstack-network-server:8000

Note: new user worked the addition

Since all components are installed on the same server, you must use localhost:8000, not chirpstack-network-server:8000. The latter is in case when using Docker, as each Docker container is accessible by its own hostname.

3 Likes

It worked here. Thanks!

When creating a new network and I put localhost:8000 since all on the same server, all in virtual machine, Im getting the context exceeded (code 2) error

Hi!
Same problem here, installed ChirpStack normally (without Docker) and via GUI it is throwing code 2 error.
Any thoughts? I do not need for know any certificate all info is blank.

Hello,
I installed also ChirpStack on a raspberry debian buster (without Docker). Everything work for some days and today when i click on some items (gateway or device) on the web interface i get the error:
Error context deadline exceeded (code 2)
Can someone help me?

Have you had any success with this? I too am getting this bug. I got this bug even after reverting back to an image that was working completely on a different SD card. The pi worked for about 2 weeks and now it throws this exception when trying to access Gateway-profiles, service-profiles, device-profiles, gateways or applications

Hey all,
I just had this issue on my R-Pi using a somewhat suspect 8Gb SD card.

I solve it by just employing some house-keeping…

I recommend you check the following:

  1. Is your SD card good/fake etc?

  2. verify all SD card image reading and writing sessions

  3. clean your Ubuntu (clear old cache and logs files) to gain more disk space if you need it (my Chirpstack stated running quite slow and after I freed up space its back to fast UI loading etc)

  4. make sure you have a large enough swap file setup

  5. make back-up of your SD card image regularly.

  6. Use a class 10 16 or 32Gb SD card

  7. fit a CPU reset button on your R-Pi and only ever power up and down the R-Pi pressing the reset button first, only ever insert/remove the SD card when the power is off!

  8. watch out for log files etc building up over time and reducing the memory available!

  9. check for linux malware

Hi @brocaar, I have installed using apt but not docker. And since certificates are optional, I haven’t provided any. How do I resolve this error?

I know this is a bit late, but I’ll comment in case it helps anyone else.
Try putting in the LAN or WAN IP address of the VM rather than ‘localhost’.
If this doesn’t fix it or your machine doesn’t have an IP address, this may be a problem with the either,

  1. The VM firewall
  2. The hypervisor/VM hosting application (e.g. I’ve run into an issue with docker-ce not resolving hostnames between containers if not connecting to a WAN)

Good luck!