warlof / seat-connector

Provide basic layer for SeAT connectors
GNU General Public License v3.0
1 stars 13 forks source link

Discord connector "oops something went wrong" #22

Closed sgeine closed 4 years ago

sgeine commented 5 years ago

With discord connector 4.0.2, Seat-connector 1.3.3 (everything current) matching callback url's, matching client id/secret, matching bot token. roles are setup on discord and seat (they were working with same bot/discord connector 3.x). I click on join server, then I get to the discord authorize join page, then after clicking authorize I get "oops something went wrong" with a long url. https://[domain-name]/seat-connector/registration/discord/callback?code=tAZVk6mRiHpDpNoV6IViNqyExsVVtu&state=d3tn9stIGM3gPCkePkf46tjH7IdgSkVjVpIqI1Wl

I can't find an error message in laravel or in nginx error log. I don't know what's wrong or how to fix it. :( I do get the below error message on cron intervals but not timestamped when I create the issue.

Warlof\Seat\Connector\Jobs\DriverApplyPolicies

ID
126976
Queue
high
Tags
connector, discord
Failed At
19-10-19 15:30:04
Error
Warlof\Seat\Connector\Exceptions\DriverSettingsException: Parameter guild_id is missing. in /var/www/seat/vendor/warlof/seat-discord-connector/src/Driver/DiscordClient.php:107
Stack trace:
#0 /var/www/seat/vendor/warlof/seat-connector/src/Jobs/DriverApplyPolicies.php(102): Warlof\Seat\Connector\Drivers\Discord\Driver\DiscordClient::getInstance()
#1 [internal function]: Warlof\Seat\Connector\Jobs\DriverApplyPolicies->handle()
#2 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#3 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#4 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#6 /var/www/seat/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#7 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Warlof\Seat\Connector\Jobs\DriverApplyPolicies))
#8 /var/www/seat/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Warlof\Seat\Connector\Jobs\DriverApplyPolicies))
#9 /var/www/seat/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(49): Illuminate\Bus\Dispatcher->dispatchNow(Object(Warlof\Seat\Connector\Jobs\DriverApplyPolicies), false)
#11 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(76): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\RedisJob), Array)
#12 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(320): Illuminate\Queue\Jobs\Job->fire()
#13 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(270): Illuminate\Queue\Worker->process('redis', Object(Illuminate\Queue\Jobs\RedisJob), Object(Illuminate\Queue\WorkerOptions))
#14 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(114): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\RedisJob), 'redis', Object(Illuminate\Queue\WorkerOptions))
#15 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('redis', 'high,medium,low...', Object(Illuminate\Queue\WorkerOptions))
#16 /var/www/seat/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('redis', 'high,medium,low...')
#17 /var/www/seat/vendor/laravel/horizon/src/Console/WorkCommand.php(46): Illuminate\Queue\Console\WorkCommand->handle()
#18 [internal function]: Laravel\Horizon\Console\WorkCommand->handle()
#19 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#20 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#21 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#22 /var/www/seat/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#23 /var/www/seat/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#24 /var/www/seat/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#25 /var/www/seat/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#26 /var/www/seat/vendor/symfony/console/Application.php(982): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /var/www/seat/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Laravel\Horizon\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /var/www/seat/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /var/www/seat/vendor/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /var/www/seat/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /var/www/seat/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 {main}
Data
{
  "client": null,
  "driver": "discord",
  "terminator": false,
  "tags": [
    "connector",
    "discord"
  ],
  "job": null,
  "connection": null,
  "queue": "high",
  "chainConnection": null,
  "chainQueue": null,
  "delay": null,
  "chained": []
}
sgeine commented 5 years ago

I am trying deleting and recreating the bot to see if that has an impact

ppfeufer commented 5 years ago

https://[domain-name]/seat-connector/registration/discord/callback? Please replace [domain-name] with your actualy SeAT domain ...

sgeine commented 5 years ago

hehe @ppfeufer :D I filtered that out for this post. It is there. I'm not getting a callback error ;) Thank you though. Deleting, recreating, and moving the bot to the top role had only a minor effect. I now show as "registered" after I follow the join server path, but I still get that error page. I'm working to get a user who has never clicked the join server button to see if he actually is joined or gets the error to distinguish if this is only an issue for people already on the discord server or one that breaks new users as well.

ppfeufer commented 5 years ago

Ok, in that case nevermind me. It's just the most common copy/paste mistake which happens pretty often though.

warlof commented 5 years ago

@sgeine be certain you've check both bot options :

sgeine commented 5 years ago

@warlof I can add public bot but it wasn't required prior or in the current/former docs. Are you sure we're talking about the same thing? Requiring Oauth2 is selected.

Screen Shot 2019-10-20 at 12 14 17 PM

"PUBLIC BOT Public bots can be added by anyone. When unchecked, only you can join this bot to servers."

I'd want other people to be able to use my bot?

warlof commented 5 years ago

Yes I do

Will update doc if it's not inside it.

Le dim. 20 oct. 2019 à 21:13, sgeine notifications@github.com a écrit :

@warlof https://github.com/warlof I can add public bot but it wasn't required prior or in the current/former docs. Are you sure we're talking about the same thing?

"PUBLIC BOT Public bots can be added by anyone. When unchecked, only you can join this bot to servers."

I'd want other people to be able to use my bot?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/warlof/seat-connector/issues/22?email_source=notifications&email_token=AAE6MMIO6TB2V6YASPW3GCDQPSUWVA5CNFSM4JCRYV62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYRPGY#issuecomment-544282523, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE6MMJZMV5C6J3HA5ABAQDQPSUWVANCNFSM4JCRYV6Q .

sgeine commented 5 years ago

@warlof I've set it to public with no effect. I also tested it with a new user who has never joined the server and it affects them equally. What happens is they do get mapped the role in seat, however, they get an 'oops something went wrong" and are not joined to the discord server. Below are the only error messages I'm able to find.

These are failures:

Screen Shot 2019-10-22 at 9 10 11 AM

also, here you can see successful user mappings

Screen Shot 2019-10-22 at 9 13 28 AM

however, none of the above people have been successfully invited to the discord server. Hopefully, this helps narrow things down.

sgeine commented 5 years ago

Here is some additional configuration data.

  1. I'm using seat-groups to automatically add anyone in my alliance to the "Alliance Member" group. this is working correctly. As soon as a member authenticates in seat they are added (or not added) to the correct role depending on their alliance membership at */15. This package has critical functionality that would greatly reduce the manual administrative overhead of a large seat installation. where you can have managed groups and automatic groups vs everything being manual.
  2. I have 8 identical roles for discord and teamspeak users. I haven't configured the teamspeak portion yet as I've been working to resolve discord first.

Below are some configuration screenshots. Additionally, I have the fitting/doctrine plugin installed as well (doesn't show in packages) and working. The current queue time for jobs being run is instantaneous.

Cannot tell if this works:

Screen Shot 2019-10-22 at 9 17 34 AM

This works:

Screen Shot 2019-10-22 at 9 18 31 AM

This works:

Screen Shot 2019-10-22 at 9 18 47 AM

Currently installed packages:

Screen Shot 2019-10-22 at 9 24 08 AM
warlof commented 5 years ago

@sgeine did you update your driver settings after changing your bot configuration ?

By the way, giving a screen of failed jobs isn't quite useful. You rather should provide the encapsulated logs disclose when hitting the failed job itself :p

sgeine commented 5 years ago

Hehe you may note I did in the initial post :) if there’s another’s log somewhere I’m happy to paste it too. I did do update all sets and updated them individually, no effect.

warlof commented 5 years ago

When I'm talking about driver settings, I'm talking about this form :

image

Doing it so will renew stored settings, including the missing guild_id which should now be returned in case you turned on the two bot options.

image

Be sure to kick the bot from your discord first.

sgeine commented 5 years ago

Here's what I did:

  1. kick bot
  2. update sets
  3. sync users
  4. re-invite public bot with uauth2 and public enabled
  5. give bot administrator privileges on server

no effect. Are there more specific errors stored somewhere for seat that is not in the common places like /var/log/nginx/errors etc? discord connector does receive the roles from the bot/discord server. Inviting actual users doesn't seem to work.

warlof commented 4 years ago

@sgeine I've recently updated doc instructions too match new things and the updated Discord UI

So, try the following :

  1. kick the bot and related role from your Discord
  2. clear cache using php artisan cache:clear command (ensure you're using proper user)
  3. go on the seat-connector settings page (under Connector > Settings)
  4. delete your Discord App from https://discordapp.com/developers/applications
  5. create a new Discord App following https://github.com/warlof/seat-discord-connector/blob/master/README.md#create-application
  6. collect credentials using https://github.com/warlof/seat-discord-connector/blob/master/README.md#retrieving-credentials
  7. setup SeAT with https://github.com/warlof/seat-discord-connector/blob/master/README.md#setup-package

CAUTION Ensure you select proper server in the drop-down list Also try to do the flow using Discord Guild Owner account

sgeine commented 4 years ago

I'll try it and hit you back, thanks again for your hard work. how is seat 4.0 coming? I can set it up on a bare rails test server if you need one.

warlof commented 4 years ago

Waiting for your feedback. About 4th Gen, it's stale for the beginning of the month due to my lack of availability. However things are going well 😉.

We got our own infrastructure, so no need to worry about servers. However, you can test the WIP version using the 4th branch.

warlof commented 4 years ago

Close due to inactivity