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

Failed Job - ImportMastodonFollowersJob #87

Open
kurucu opened this issue Apr 6, 2024 · 10 comments
Open

Failed Job - ImportMastodonFollowersJob #87

kurucu opened this issue Apr 6, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@kurucu
Copy link

kurucu commented Apr 6, 2024

Steps to reproduce the problem

  1. Attempt to import followers

Expected behaviour

The job should run and import followers

Actual behaviour

It fails with "Undefined array key 'client_id'"

Detailed description

ErrorException: Undefined array key "client_id" in /.../vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php:47

Specifications

PHP | 8.2.14
Laravel | 10.48.4
Horizon | 5.23.2.0
Mixpost | 2.0.2.0
Mixpost Enterprise | 2.0.0.0

@kurucu kurucu added the bug Something isn't working label Apr 6, 2024
@lao9s
Copy link
Member

lao9s commented Apr 7, 2024

Thank you for reporting.
I'll check it and fix as soon as possible!

@kurucu
Copy link
Author

kurucu commented Apr 7, 2024

No issues Dima. If you need more information, let me know.

@lao9s
Copy link
Member

lao9s commented Apr 12, 2024

@kurucu do you use Docker?

@lao9s
Copy link
Member

lao9s commented Apr 12, 2024

@kurucu Abstracts/SocialProviderManager.php:47 is an empty line. Maybe you did not terminate Horizon after upgrading?

@kurucu
Copy link
Author

kurucu commented Apr 13, 2024

@lao9s That's part of the deploy script, and also I can see I tried that before raising this ticket manually 😂

So no, that's not it. Tried again just now, to make sure.

@kurucu
Copy link
Author

kurucu commented Apr 13, 2024

@kurucu do you use Docker?

No, straight server.

@kurucu
Copy link
Author

kurucu commented Apr 13, 2024

Copying a few more lines from the console output in case they help.

Exception
ErrorException: Undefined array key "client_id" in /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php:47
Stack trace:
#0 /home/mixpost-app/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(255): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php(47): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/SocialProviderManager.php(151): Inovector\Mixpost\Abstracts\SocialProviderManager->buildConnectionProvider()
#3 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php(39): Inovector\Mixpost\SocialProviderManager->connectMastodonProvider()
#4 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php(26): Inovector\Mixpost\Abstracts\SocialProviderManager->createConnection()
#5 /home/mixpost-app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Inovector\Mixpost\Abstracts\SocialProviderManager->connect()
#6 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/Concerns/UsesSocialProviderManager.php(13): Illuminate\Support\Facades\Facade::__callStatic()
#7 /home/mixpost-app/vendor/inovector/mixpost-pro-team/src/SocialProviders/Mastodon/Jobs/ImportMastodonFollowersJob.php(58): Inovector\Mixpost\SocialProviders\Mastodon\Jobs\ImportMastodonFollowersJob->connectProvider()

@kurucu
Copy link
Author

kurucu commented May 10, 2024

Hey @lao9s. I'm still getting this fail constantly, and for many user accounts.

I've also seen that ImportMastodonPostsJob is also failing, with a similar error. I've reset all cache, and restarted all services.

The primary error is still:

ErrorException: Undefined array key "client_id" in vendor/inovector/mixpost-pro-team/src/Abstracts/SocialProviderManager.php:47

All of my dependencies are up to date, and I can find a relevant line at that location.

    protected function buildConnectionProvider(string $provider, array $config): SocialProvider
    {
        // THIS IS LINE 47
        $connection = (new $provider($this->container->make('request'), $config['client_id'], $config['client_secret'], $config['redirect'], array_merge($this->values, $config['values'] ?? [])));

        if (!$connection instanceof SocialProvider) {
            throw new \Exception('The provider must be an instance of SocialProvider');
        }

        return $connection;
    }

@lao9s
Copy link
Member

lao9s commented May 11, 2024

@kurucu

Maybe this can help you: https://docs.mixpost.app/troubleshooting#mastodon-connection-issue

If not, I'll debug your app.

@kurucu
Copy link
Author

kurucu commented May 11, 2024

Hey Dima,

I've tried it on one account to see what happens, just because of this:

This action may have a negative impact on scheduled posts and authenticated accounts with Mastodon on troet.cafe server.

What would cause this step to be needed? Once I see what happens there, I'll let you know.

If that is the problem, do I need to get all my users to reconnect? Multiple accounts are affected. Can any of this be automated if so, and if not, could users be automatically be notified if they are affected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants