Closed Ferrariic closed 2 years ago
Says invalid or expired token, which is odd - token should be fine
Just reset your system's clock. If an API request to authenticate comes from a server that claims it is a time that is outside of 15 minutes of Twitter time, it will fail with a 401 error. Show activity on this post. You might just have made a mistake in copying the Access Token from the apps.twitter.com page.
Should be resolved now, updated the relevant keys in tweepy
ERROR:apscheduler.executors.default:Job "broadcast_bans (trigger: cron[hour='20', minute='5'], next run at: 2022-05-20 20:05:00 UTC)" raised an exception
Thu, May 19 2022 3:12:28 pm | Traceback (most recent call last): Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/site-packages/apscheduler/executors/base.py", line 125, in run_job Thu, May 19 2022 3:12:28 pm | retval = job.func(*job.args, *job.kwargs) Thu, May 19 2022 3:12:28 pm | File "/usr/src/app/src/banbroadcaster/main_broadcaster.py", line 18, in broadcast_bans Thu, May 19 2022 3:12:28 pm | banbroadcaster.functions.post_bans_tweet(num_bans=num_bots_banned) Thu, May 19 2022 3:12:28 pm | File "/usr/src/app/src/banbroadcaster/functions.py", line 145, in post_bans_tweet Thu, May 19 2022 3:12:28 pm | TWITTER_API.update_status(msg) Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/site-packages/tweepy/api.py", line 46, in wrapper Thu, May 19 2022 3:12:28 pm | return method(args, **kwargs) Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/site-packages/tweepy/api.py", line 1121, in update_status Thu, May 19 2022 3:12:28 pm | return self.request( Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/site-packages/tweepy/api.py", line 257, in request Thu, May 19 2022 3:12:28 pm | raise Unauthorized(resp) Thu, May 19 2022 3:12:28 pm | tweepy.errors.Unauthorized: 401 Unauthorized Thu, May 19 2022 3:12:28 pm | 89 - Invalid or expired token. Thu, May 19 2022 3:12:28 pm | ERROR:apscheduler.executors.default:Error running job be4a92e6995c44e9ac5f88cf125808cd Thu, May 19 2022 3:12:28 pm | concurrent.futures.process._RemoteTraceback: Thu, May 19 2022 3:12:28 pm | ''' Thu, May 19 2022 3:12:28 pm | Traceback (most recent call last): Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/concurrent/futures/process.py", line 384, in wait_result_broken_or_wakeup Thu, May 19 2022 3:12:28 pm | result_item = result_reader.recv() Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/multiprocessing/connection.py", line 256, in recv Thu, May 19 2022 3:12:28 pm | return _ForkingPickler.loads(buf.getbuffer()) Thu, May 19 2022 3:12:28 pm | File "/usr/local/lib/python3.10/site-packages/tweepy/errors.py", line 48, in init Thu, May 19 2022 3:12:28 pm | response_json = response.json() Thu, May 19 2022 3:12:28 pm | AttributeError: 'str' object has no attribute 'json' Thu, May 19 2022 3:12:28 pm | ''' Thu, May 19 2022 3:12:28 pm | Thu, May 19 2022 3:12:28 pm | The above exception was the direct cause of the following exception: Thu, May 19 2022 3:12:28 pm | Thu, May 19 2022 3:12:28 pm | concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.