Community edition (1.1.8) fnuplinkhandler panic: invalid memory address or nil pointer dereference: errorString

Hi,

I was going through the tutorial for the AWS IoT Core integration for the community edition, and I came across a panic when the uplink handler function was being executed. I have not deviated from the tutorial, and all I tried was simulating an uplink. I can see data being received on the thethings/lorawan/TTNIntegrationTest/uplink MQTT topic, but nothing on the lorawan/# topic.

Here’s the request (items in <stuff> contained ids I wasn’t sure were sensitive or not so I removed them) :

{
  "end_device_ids": {
    "device_id": "ian-lora-e5-abp",
    "application_ids": {
      "application_id": "aether"
    },
    "dev_eui": "<eui>"
  },
  "correlation_ids": [
    "as:up:<key id>",
    "rpc:/ttn.lorawan.v3.AppAs/SimulateUplink:<not sure what this is but I removed it anyway>"
  ],
  "received_at": "2022-02-09T19:32:05.612165812Z",
  "uplink_message": {
    "f_port": 1,
    "frm_payload": "aUIA",
    "rx_metadata": [
      {
        "gateway_ids": {
          "gateway_id": "test"
        },
        "rssi": 42,
        "channel_rssi": 42,
        "snr": 4.2
      }
    ],
    "settings": {
      "data_rate": {
        "lora": {
          "bandwidth": 125000,
          "spreading_factor": 7
        }
      }
    }
  },
  "simulated": true
}

Here are the logs messages:

Handle uplink message for DevEUI "<deveui>"
runtime error: invalid memory address or nil pointer dereference: errorString
[
{
    "path": "github.com/aws/aws-lambda-go@v1.27.1/lambda/errors.go",
    "line": 39,
    "label": "lambdaPanicResponse"
}
,
{
    "path": "github.com/aws/aws-lambda-go@v1.27.1/lambda/function.go",
    "line": 36,
    "label": "(*Function).Invoke.func1"
}
,
{
    "path": "runtime/panic.go",
    "line": 1038,
    "label": "gopanic"
}
,
{
    "path": "runtime/panic.go",
    "line": 221,
    "label": "panicmem"
}
,
{
    "path": "runtime/signal_unix.go",
    "line": 735,
    "label": "sigpanic"
}
,
{
    "path": "fnhandleuplink/uplink.go",
    "line": 200,
    "label": "handleUplink"
}
,
{
    "path": "reflect/value.go",
    "line": 543,
    "label": "Value.call"
}
,
{
    "path": "reflect/value.go",
    "line": 339,
    "label": "Value.Call"
}
,
{
    "path": "github.com/aws/aws-lambda-go@v1.27.1/lambda/handler.go",
    "line": 124,
    "label": "NewHandler.func1"
}
,
{
    "path": "github.com/aws/aws-lambda-go@v1.27.1/lambda/handler.go",
    "line": 24,
    "label": "lambdaHandler.Invoke"
}
,
{
    "path": "github.com/aws/aws-lambda-go@v1.27.1/lambda/function.go",
    "line": 64,
    "label": "(*Function).Invoke"
}
,
{
    "path": "reflect/value.go",
    "line": 543,
    "label": "Value.call"
}
,
{
    "path": "reflect/value.go",
    "line": 339,
    "label": "Value.Call"
}
,
{
    "path": "net/rpc/server.go",
    "line": 377,
    "label": "(*service).call"
}
,
{
    "path": "runtime/asm_amd64.s",
    "line": 1581,
    "label": "goexit"
}
]

Did I do something dumb (highly possible), or is this an error with the aws integration (1.1.8)?

It looks like uplink simulation isn’t supported with the AWS IoT Integration because it doesn’t set received_at in uplink_message … I fixed this just now, version 1.1.9 is building and should be available in 10 minutes from now.

Awesome, thank you! I forgot to follow up and say that I was able to successfully send messages from TTS to AWS IoT once I got my hands on my gateway and end-device.