Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

RouterException: Server error: INVALID_ARGUMENT: Request contains an invalid argument. #1373

Open
jrconlin opened this issue Mar 30, 2020 · 10 comments · Fixed by #1437
Open

Comments

@jrconlin
Copy link
Member

jrconlin commented Mar 30, 2020

Staring since around Mar. 16

https://sentry.prod.mozaws.net/operations/autopush-prod/issues/6072684/

RouterException: Server error: INVALID_ARGUMENT: Request contains an invalid argument.
  File "twisted/internet/defer.py", line 654, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "autopush/router/fcmv1client.py", line 129, in error
    raise RouterException("Server error: {}".format(failure.value))

RouterException: Server error: INVALID_ARGUMENT: Request contains an invalid argument.
@jrconlin jrconlin added this to Backlog: Misc in Services Engineering via automation Mar 30, 2020
@jrconlin jrconlin moved this from Backlog: Misc to Backlog: Push in Services Engineering Mar 30, 2020
@jrconlin
Copy link
Member Author

Not really seeing where the error might be from the docs

@AzureMarker
Copy link
Contributor

The response should contain more information about what was invalid: https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode#ENUM_VALUES.INVALID_ARGUMENT

@jrconlin
Copy link
Member Author

jrconlin commented Aug 6, 2020

Right, but the question is whether or not the error handler for treq allows the response body to be read. I think so, but I'd have to play around a bit to make sure.

@Adrianotiger
Copy link

Adrianotiger commented Oct 9, 2020

I have the same error message, when I try to send a push notification to a mobile device from a php-script.
It works on Firefox for desktop, but not Firefox on mobile (it works on Edge and Chrome), I get this message:

Server error: INVALID_ARGUMENT: Request contains an invalid argument.

"endpoint": https://updates.push.services.mozilla.com/wpush/v1/gAAAAABfgDHFI3uKHq48tJLjFHD1Osft2o_4YSJgHeswI1XAPVODFc-ZYlqj2wm...
"code": 500,
"errno": 999,
"error": "Internal Server Error",
"more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes"

How should I know what is wrong, if the answer is a errno999?

@AzureMarker
Copy link
Contributor

@Adrianotiger The cause of this error was due to message size limitations. Autopush was allowing larger message sizes than what Firebase would allow. Check the size of your messages, though that error is generic enough that you may have a different problem. The fix for this specific issue is targeted for release 1.58.2: #1437

@jrconlin
Copy link
Member Author

jrconlin commented Oct 9, 2020 via email

@Adrianotiger
Copy link

Thank you. Finally I was able to implement it on Firefox mobile, using aes128gcm as encryption and setting autopad to false.
Edge mobile still receive an empty payload, but probably it is a browser bug.

Services Engineering automation moved this from Backlog: Push to Done Oct 12, 2020
@tublitzed tublitzed moved this from Done to Archived in Services Engineering Oct 12, 2020
@tublitzed tublitzed moved this from Archived to Done in Services Engineering Oct 12, 2020
@tublitzed
Copy link
Contributor

Re-opening as this isn't fixed in this release.

@tublitzed tublitzed reopened this Oct 12, 2020
Services Engineering automation moved this from Done to Prioritized Oct 12, 2020
@tublitzed tublitzed moved this from Prioritized to Backlog: Push in Services Engineering Oct 12, 2020
@tublitzed tublitzed moved this from Backlog: Push to Prioritized in Services Engineering Oct 12, 2020
@tublitzed tublitzed moved this from Prioritized to Backlog: Push in Services Engineering Jan 5, 2021
@jrconlin
Copy link
Member Author

jrconlin commented May 3, 2021

Seeing a spike in these. Really need to add some additional info to the sentry error including:
VAPID sub,
body length,
and a breakdown of google.rpc.BadRequest

@pjenvey
Copy link
Member

pjenvey commented May 4, 2021

The spike began on May 1st (suspicious).

and a breakdown of google.rpc.BadRequest

AFAICT from their general error docs and the firebase code docs for INVALID_ARGUMENT "An extension of type google.rpc.BadRequest is returned to specify which field was invalid." which would be the details error field.

Many of the errors seen during the spike have no details field (we emit "INVALID_ARGUMENT: Request contains an invalid argument. No Details").

There's also some "The registration token is not a valid FCM registration token" and CancelledError (likely timeouts) errors.

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

Successfully merging a pull request may close this issue.

5 participants