Error context deadline exceeded

Could you post the full error string?

Hi brocaar,
I am not able to see the loraserver and lora-app-server logs.
I wanted to know why context deadline exceeded (code: 2) will display in web page. (not always)

On what system are you running LoRaServer and LoRaAppServer? Without the logs it is almost impossible to find out the cause of this error.

Are you using docker? Just happened to me because did not take into account that docker machines are isolated (new to this) and had to use the machine IP.

If you are using docker try this to see logs

$ docker logs CONTAINER_NAME

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?