Dear community,
We are using twitter4j: 4.0.7 library to connect and twitter account encounters frequent error code:89 message:Invalid or expired token for no obvious reasons.
twitter4j.TwitterException: 401:Authentication credentials were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
message - Invalid or expired token.
code - 89
Looks that account is still active there is no expiration message and even able to reply on tweets.
- The account is not suspended (if I log in with Twitter Web, I can tweet and do pretty much everything manually).
- The app is not suspended (in the developer dashboard, there is no sign of suspension).
- The tokens are not marked as invalid or expired in the Tokens tab.
- If same token is working fine for some of the call.
We have also verified below points.
1. Twitter API daily limit
We are using token for auth at @2 min per request. So it is in limit of Auth 450/15
2. Do we need to change API token every few days/months.
But as per doc looks like token is not expiring automatically.
3. Time mismatch
$ timedatectl
Local time: Tue 2022-02-22 12:40:04 UTC
Universal time: Tue 2022-02-22 12:40:04 UTC
RTC time: Tue 2022-02-22 12:40:04
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
Logs for reference
I would really appreciate some help. Thank you very much!
system
closed
#2
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.