Events Arrive Once Then Never Again? Debugging Advice?

Alright, I’ve got a weird one… :frowning: I realize this isn’t a ton to go on, but I think I’ve just been spinning my wheels for a bit.

I am working on an integration to a Lua/OpenResty (Nginx) application. I’ve been using Cloudflare’s raven-lua package.

I’ve hooked everything up, and after running my application, I triggered an error (just calling an undefined function). In my app, while testing, I called captureMessage and captureException. Both events arrive once. Then never again…

I’m using a self-hosted Sentry, so I thought maybe that was it… but then I tried with the free hosted version and both exhibit the same behavior.

So, what should I try? Naturally I’ve rebooted the app and I can see the event being sent to Sentry.

{
 "culprit": "handle_error",
 "event_id": "cb511a8b2e7fec971109ec0d397314ba",
 "exception": [
  {
   "message": "Test",
   "module": "test module",
   "stacktrace": {
    "frames": [
     {
      "filename": "content_by_lua(locations.conf:23)",
      "lineno": 2
     },
     {
      "filename": "...el/Users/michael/.luarocks/share/lua/5.1/lapis/nginx.lua",
      "function": "serve",
      "lineno": 230
     },
     {
      "filename": "...rs/michael/.luarocks/share/lua/5.1/lapis/application.lua",
      "function": "dispatch",
      "lineno": 177
     },
     {
      "filename": "...rs/michael/.luarocks/share/lua/5.1/lapis/application.lua",
      "function": "render_error_request",
      "lineno": 141
     },
     {
      "filename": "./app.lua",
      "function": "handle_error",
      "lineno": 226
     }
    ]
   },
   "type": "Test Type 2",
   "value": "...rs/michael/.luarocks/share/lua/5.1/lapis/application.lua:401: ./controllers/project.lua:95: attempt to call global 'xyz' (a nil value)\nstack traceback:\n\t./controllers/project.lua: in function <./controllers/project.lua:87>1"
  }
 ],
 "level": "error",
 "logger": "root",
 "message": "...rs/michael/.luarocks/share/lua/5.1/lapis/application.lua:401: ./controllers/project.lua:95: attempt to call global 'xyz' (a nil value)\nstack traceback:\n\t./controllers/project.lua: in function <./controllers/project.lua:87>1",
 "platform": "lua",
 "server_name": "undefined",
 "timestamp": "2020-10-31T08:45:38"
}

I super appreciate any help! This has stumped me for a while. :confused:

The library I was using was not configured to generate random event IDs which explains this behavior. Terribly confusing, but now it all makes sense.

To add: The best way figured this out was tail -fing the main weblog for the Sentry server on my self-hosted instance which output “duplicate event id” warnings. Re-inspecting the logs from my own local debugging does confirm that event IDs were the same, but I didn’t wasn’t that closely reading the JSON output to realize they were exactly the same.