Closed kevgrig closed 2 years ago
Just adding a note here that this problem is intermittent; generally, notifications work.
I've updated my Gemfile as follows to bring in the extra diagnostics from PR #36 and when the problem is reproduced I'll add details to this issue.
#gem "exponent-server-sdk"
gem 'exponent-server-sdk', git: "https://github.com/aki77/expo-server-sdk-ruby.git", branch: "fix-unknown-error"
@kevgrig The same message error with me, but the notification is not delivered
@vandemberg I haven't seen it since but we're not pushing many notifications through. I updated my server code with the additional logging so as soon as it occurs again, I'll post the details here.
@kevgrig For me, the issue was the version. I had tokens one got tied with the older expo version and the other one with the new expo version. So, in my case, the unknown error seems to be like this
Unknown error format: {"errors":[{"code":"PUSH_TOO_MANY_EXPERIENCE_IDS","message":"All push notification messages in the same request must be for the same project; check the details field to investigate conflicting tokens.","details":{"@project":["ExponentPushToken[token1]","ExponentPushToken[token2]","ExponentPushToken[token3]","ExponentPushToken[token4"],"@user1/project":["ExponentPushToken[userToken1]","ExponentPushToken[userToken2]"]},"isTransient":false}]}
I had to clear the device ids and re-registered them to make it work.
I've reproduced with additional debug and the error is an HTTP 504. So it seems to be a backend issue:
Oct 25 13:00:59 web53 rails[54425]: [1c29d553-92d1-42f7-b445-a072591a3311] handle_exception: [...]<Exponent::Push::UnknownError: Unknown error format: <html>#015#012<head><title>504 Gateway Time-out</title></head>#015#012<body>#015#012<center><h1>504 Gateway Time-out</h1></center>#015#012<hr><center>nginx</center>#015#012</body>#015#012</html>
Looks like a known issue and the frequency seems to have increased recently based on the dates of recent comments, so I guess I'll check for the 504 and put in retries: https://github.com/expo/expo/issues/6486
Response from expo development:
we recommend retrying on failure: https://docs.expo.dev/push-notifications/sending-notifications/#retry-on-failure
@kevgrig For me, the issue was the version. I had tokens one got tied with the older expo version and the other one with the new expo version. So, in my case, the unknown error seems to be like this
Unknown error format: {"errors":[{"code":"PUSH_TOO_MANY_EXPERIENCE_IDS","message":"All push notification messages in the same request must be for the same project; check the details field to investigate conflicting tokens.","details":{"@project":["ExponentPushToken[token1]","ExponentPushToken[token2]","ExponentPushToken[token3]","ExponentPushToken[token4"],"@user1/project":["ExponentPushToken[userToken1]","ExponentPushToken[userToken2]"]},"isTransient":false}]}
I had to clear the device ids and re-registered them to make it work.
what have you done to fix this error? updated the version of the exponent-server-sdk gem or others.
@santucorephp
what have you done to fix this error? updated the version of the exponent-server-sdk gem or others.
You must add a retry. Expo development wrote, "we recommend retrying on failure: https://docs.expo.dev/push-notifications/sending-notifications/#retry-on-failure"
I know this is similar to issues #33, #37, and #38; however, it has slightly different symptoms (different top expo SDK stack frames, only sending a single message, etc.). The following shows my application debug log sending a single message to a single device (details removed for privacy), and expo-server-sdk-ruby throws
Exponent::Push::UnknownError: Unknown error format: #<Typhoeus::Response:0x00007f0bf98a6248>
fromexponent-server-sdk.rb } process_response