Closed topclaudy closed 1 year ago
Can you please give a bit more details?
Are you already using v8?
Can you please give a bit more details?
Are you already using v8?
Yes! It happens on v8
Ok thx. Any chance you can dump the Twitter call response? Should be this one: https://github.com/laravel-notification-channels/twitter/blob/master/src/TwitterChannel.php#L80
Given the error message, I think the call response is null in case of error. Do you want me to dump the response in case of success?
Experiencing the same error when I try to post a tweet that has an image.
Undefined property: stdClass::$media_id_string
I dumped out the response from line 82. Here is the response.
Thanks. Can you confirm, that just sending a text tweet works?
I have managed to fix the issues by regenerating the credentials.
I also regenerated credentials before opening this issue, and the error persists (intermittently)
No problems with text-only tweets.
I dumped out the response from line 82. Here is the response.
I suggest you start by debugging Twitter response.
I can't debug the error. This seems to work now without change in my code. As I said, it's intermittent in my situation and this start happening after upgrading to v8.
Hey, with all the changes on Twitter API, it is often really difficult to debug issues because, aus you said, sometimes it just works again. For me it sounds like a problem with the app and credentials on the Twitter side, but if it keeps coming back, please post here again, and also the API response from Twitter so I can help debug. All the best 👍
Problem persists!! Text-only tweets work fine. Tweets with image(s) result in error. All attempts failed yesterday.
Hey, sorry to hear that. Have you checked what the Twitter response is? This would help with debugging. (see messages above where to dump the Twitter response)
Here is the response: The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.
I ran a job to post 2 notifications. The first one ALWAYS succeed. The second one results in this error. It looks like a problem when posting more than one tweets within 1 second.
Here is the response: The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.
I ran a job to post 2 notifications. The first one ALWAYS succeed. The second one results in this error. It looks like a problem when posting more than one tweets within 1 second.
It keeps happening even when I pause for 15 seconds before the second tweet.
Thanks for the update. I can take a look tomorrow.
I tried it with the underlying Twitteroauth package and there I made it work to send a text and image.
@Nelwhix could you maybe take a look at this issue and see if you can tweet a text and image with this package?
Okay
I just tried posting three tweets consecutively with image and it succeeded. The error message The Twitter REST API v1 is no longer active. Please migrate to API v1.1
. is strange because the package uses twitter API v1.1 for media upload. maybe if we could have more details of his setup so we know what could trigger the issue
Thanks a lot @Nelwhix. 🙏 The issue might be connected to the app 🤔
@topclaudy have you tried to create a new Twitter app with new credentials? Could be an issue if the app already exists longer.
Hi @christophrumpel I created a new app and the error persists (same error: The Twitter REST API v1 is no longer active...). The new credentials from the new app work for Laravel Socialite tough. This is weird!
This is really strange =/ I also ran into a few issues with Twitter where I do not why they do not work.
The app is also within a "project" on the Twitter developer page?
Yes! The app is within a project.
I noticed that the 2 consecutive tweets (with image) were posted successfully in the first attempt just after creating the new app/credentials. But the subsequent attempts failed.
This sounds really weird. At this point I'm not sure how or if I can help.
What you could do is check out the package that we use under the hood: https://twitteroauth.com/ You could test if it works with this package, I use just that package in some projects too, because it is quite easy to use too.
@christophrumpel Thanks for the tips. It looks like a problem on Twitter... Oops! X. I'm gonna close this issue.
This was definitely an issue with the package. I updated to the last version and this issue is solved.
ErrorException: Attempt to read property "media_id_string" on null in /var/www/stocktreats.com/vendor/laravel-notification-channels/twitter/src/TwitterChannel.php:82
This sometimes happens when posting tweet with image (just one image in my case)