Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exponent::Push::UnknownError: Unknown error format: #<Typhoeus::Response... #39

Closed
kevgrig opened this issue Feb 9, 2021 · 9 comments
Closed

Comments

@kevgrig
Copy link

kevgrig commented Feb 9, 2021

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> from exponent-server-sdk.rb } process_response

Feb 09 22:45:04 web24 rails[3377]: [e3013c2e-16f0-47dc-a61d-78d33bb36db8] Notification.try_send_notification for identity 2194: [
                                                         [0] {
                                                                   :to => "ExponentPushToken[$REMOVED]",
                                                                 :body => "$SUBJECT",
                                                                :sound => "default",
                                                                :badge => 0,
                                                             :priority => "high",
                                                                 :data => {
                                                                              :identity => 2194,
                                                                 :notification_category => "$CATEGORY",
                                                                               :subject => "$SUBJECT"
                                                             }
                                                         }
                                                     ]
Feb 09 22:46:05 web24 rails[3377]: [e3013c2e-16f0-47dc-a61d-78d33bb36db8] ApplicationController.catchall: #<Exponent::Push::UnknownError: Unknown error format: #<Typhoeus::Response:0x00007f0bf98a6248>>
Feb 09 22:46:05 web24 rails[3377]: [e3013c2e-16f0-47dc-a61d-78d33bb36db8] ApplicationController.catchall exception details: #<Exponent::Push::UnknownError: Unknown error format: #<Typhoeus::Response:0x00007f0bf98a6248>
                                                             /var/www/html/app/vendor/bundle/ruby/2.6.0/gems/exponent-server-sdk-0.1.0/lib/exponent-server-sdk.rb:127:in `process_response'
                                                             /var/www/html/app/vendor/bundle/ruby/2.6.0/gems/exponent-server-sdk-0.1.0/lib/exponent-server-sdk.rb:63:in `send_messages'
                                                             /var/www/html/app/app/models/notification.rb:213:in `try_send_notification' [...]
kevgrig added a commit to kevgrig/expo-server-sdk-ruby that referenced this issue Feb 10, 2021
@kevgrig
Copy link
Author

kevgrig commented Feb 10, 2021

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"

@vandemberg
Copy link

@kevgrig The same message error with me, but the notification is not delivered

@kevgrig
Copy link
Author

kevgrig commented Feb 18, 2021

@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.

@sindhu5353
Copy link

@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.

@kevgrig
Copy link
Author

kevgrig commented Oct 28, 2021

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>

@kevgrig
Copy link
Author

kevgrig commented Oct 28, 2021

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: expo/expo#6486

@kevgrig
Copy link
Author

kevgrig commented Oct 29, 2021

Response from expo development:

we recommend retrying on failure: https://docs.expo.dev/push-notifications/sending-notifications/#retry-on-failure

@santucorephp
Copy link

@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.

@kevgrig
Copy link
Author

kevgrig commented Oct 28, 2022

@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"

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

No branches or pull requests

4 participants