Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Hapi bug - AssertionError [ERR_ASSERTION]: Unknown event request-error" #2542

Closed
jrgm opened this issue Jul 25, 2018 · 8 comments
Closed

Hapi bug - AssertionError [ERR_ASSERTION]: Unknown event request-error" #2542

jrgm opened this issue Jul 25, 2018 · 8 comments
Assignees
Labels

Comments

@jrgm
Copy link
Contributor

jrgm commented Jul 25, 2018

At least two problems to begin with. Perhaps the third is a casualty of one of the first two.

/cc @mozilla/fxa-devs

Really just one problem: an issue with the HAPI upgrade server events model.

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

Jul 25 19:15:58 ip-172-31-6-158.ec2.internal docker[12519]: {"Timestamp":1532546158959000000,"Logger":"fxa-auth-server",
"Type":"promise.unhandledRejection","Severity":0,"Pid":1,"EnvVersion":"2.0","Fields":{
"op":"promise.unhandledRejection","error":"AssertionError [ERR_ASSERTION]: Unknown event request-error"}}

Jul 25 19:15:59 ip-172-31-6-158.ec2.internal docker[12519]: {"Timestamp":1532546159086000000,"Logger":"fxa-auth-server",
"Type":"sms.budget.error","Severity":2,"Pid":1,"EnvVersion":"2.0","Fields":{
"op":"sms.budget.error","err":"Cannot read property 'Maximum' of undefined"}}

Jul 25 19:16:13 ip-172-31-6-158.ec2.internal docker[12519]: {"Timestamp":1532546173935000000,"Logger":"fxa-auth-server",
"Type":"uncaughtException","Severity":0,"Pid":1,"EnvVersion":"2.0","Fields":{
"error":"TypeError: Cannot read property 'stat' of null","stack":"
at Timeout.logStatInfo [as _onTimeout] (/app/bin/key_server.js:72:21)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)"}}

Jul 25 19:16:14 ip-172-31-6-158.ec2.internal systemd[1]: docker-fxa-auth.service: main process exited, code=exited, status=1/FAILURE

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

I'm checking the SMS one out now.

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

So on some startups, sms budget is ok: "isBudgetOk":true,"current":0.46824.

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

The request-error bug can be duplicated locally with SENTRY_DSN=http://127.0.0.1/ npm start.

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

hapijs/hapi#3658
'request-error' -> { name: 'request', channel: 'error' } (note that the listener signature is different and that it will pass a full event object instead of the previous err which can be accessed now via event.error).

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

Perhaps:

-    server.events.on('request-error', function (request, err) {
+    server.events.on({ name: 'request', channel: 'error'}, function (request, event) {
+      const err = event && event.error || null

@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

So the sms undefined message is ~normal and not fatal.

I'm going to disable sentry in stage to get this train up and running.

@jrgm jrgm changed the title [train-117] v1.117.0 fails to start in stage Hapi bug - AssertionError [ERR_ASSERTION]: Unknown event request-error" Jul 25, 2018
@jrgm jrgm added the blocker label Jul 25, 2018
@jrgm
Copy link
Contributor Author

jrgm commented Jul 25, 2018

Blocks train-117 /cc @vladikoff @deeptibaghel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants