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

Hubs Cloud discord bot is unreliable + difficult to setup + restart after problem #128

Open
robinkwilson opened this issue Nov 10, 2020 · 30 comments
Labels
bug Something isn't working jira-hubs-cloud P2 Address when able

Comments

@robinkwilson
Copy link
Contributor

robinkwilson commented Nov 10, 2020

Investigate Discord bot issues when deployed on Hubs Cloud.

We've heard reports:

  • Not able to setup the discord bot
  • After setup, the discord bot breaks and you can't restart it
  • Doesn't respond to commands

┆Issue is synchronized with this Jira Task

@robinkwilson robinkwilson added the bug Something isn't working label Nov 10, 2020
@robinkwilson robinkwilson changed the title Can't set up Hubs Cloud discord bot + it often crashes + unable to restart it again successfully Hubs Cloud discord bot is unreliable + difficult to setup + restart after problem Nov 10, 2020
@robinkwilson
Copy link
Contributor Author

@ConstantChange
Copy link

Happy to test this with you when you are ready. This goes way back to April where we gave this a really good try.

@robinkwilson robinkwilson added the P2 Address when able label Nov 12, 2020
@klercke
Copy link

klercke commented Nov 15, 2020

Robin, I'm in the process of making a Discord bot for our event as mentioned in mozilla/hubs#3303. I figured I may as well try to copy over the functionality we need from the official bot (primarily the chat features). Is there an "easy" way to get the chat from a room without having to be present in it? Sorry if this isn't the right place to be asking.

@joone-org
Copy link

joone-org commented Dec 9, 2020

Is this fixed? Or... could we still access the instructions at our own risk?

@ghost
Copy link

ghost commented Feb 2, 2021

Is this fixed? Or... could we still access the instructions at our own risk?

Guess not

@Ronald-MannMade
Copy link

Happy to test out anything as well

@blairmacintyre
Copy link

Any update on this? We're about to try setting up a discord bot on our hubs cloud instance, wanted to know what the status is.

@robinkwilson
Copy link
Contributor Author

I'm afraid we haven't had the resources to complete any additional work on the discord bot for HC unfortunately. We've been focused on core platform performance issues and the new UI.

This issue is still open as is.

@blairmacintyre
Copy link

hmmm, that's a shame. Are any of the integrations (slack, discord, whatever) working with hubs cloud?

@botissues
Copy link

Hello, I see this is a bit of a dead thread. has there been any updates made?

@tokyoronin
Copy link

still not working

@botissues
Copy link

still not working

Yes, is there any known alternatives, I really need this feature.

@joone-org
Copy link

joone-org commented Oct 15, 2021 via email

@botissues
Copy link

Use this: MozillaReality/hubs-docs@f5cfb53

Thank you so much! I am trying to do this now but I am having trouble SSH into the AWS server, is there a guide for this or can anyone point me in the right direction.

@pattersonbl2
Copy link
Contributor

Update: We may have found a possible fix anybody willing to test this adding the bot using this https://docs.google.com/document/d/1wDc-Dd8oiYR0SiNiPDQtgtH1OlKbKQP2Tr5pKKq25KU

@blairmacintyre
Copy link

The doc is locked ...

@pattersonbl2
Copy link
Contributor

should be unlocked now.

@botissues
Copy link

you also have to ssh into the ec2 instance. I got it working. using the guide from @yoshway

@smakhtin
Copy link

smakhtin commented Feb 6, 2022

Is it works for anyone? After setup i can create a room via bot, but can't login to this room, Hubs Cloud says that i don't have correct permissions to access the room.

@smakhtin
Copy link

smakhtin commented Feb 7, 2022

For those who interested, i found solution - version of Reticulum that shipped with Hubs Cloud has a bug. If you update Reticulum from stable channel by hands this problem disappears. Tested on mozillareality/reticulum/1.0.1/20220126003355 - works, but mozillareality/reticulum/1.0.1/20210618144438 don't - always blocks login through Discord.

@drtidcom
Copy link

For those who interested, i found solution - version of Reticulum that shipped with Hubs Cloud has a bug. If you update Reticulum from stable channel by hands this problem disappears. Tested on mozillareality/reticulum/1.0.1/20220126003355 - works, but mozillareality/reticulum/1.0.1/20210618144438 don't - always blocks login through Discord.

Quite Interested although I am still a noob and using the AMS out of the box...

Being such a noob, do you know or could you direct me in updating to the working version?

Thanks in advance!

@smakhtin
Copy link

@drtidcom you need to check Chef Habitat documentation - https://docs.chef.io/habitat/.

@drtidcom
Copy link

drtidcom commented Feb 11, 2022

Thank you, on it!

@thislooksrare
Copy link

@smakhtin @drtidcom can you share your solution? How can I upgrade this on a running AWS installation? Can I somehow just run bio svc load with some parameters to update this reticulum to the newest build? Would apprechiate any help here

@Bruguera-cbcat
Copy link

Bruguera-cbcat commented Mar 8, 2022

@smakhtin @drtidcom can you share your solution? How can I upgrade this on a running AWS installation? Can I somehow just run bio svc load with some parameters to update this reticulum to the newest build? Would apprechiate any help here

You probably have a newest version running, you can check with "sudo bio sup status" in the app server. I get the discord bot working but I can't log in trough discord, someone found a solution?

@johnshaughnessy
Copy link
Contributor

johnshaughnessy commented Mar 12, 2022

#128 (comment)

For those who interested, i found solution - version of Reticulum that shipped with Hubs Cloud has a bug. If you update Reticulum from stable channel by hands this problem disappears. Tested on mozillareality/reticulum/1.0.1/20220126003355 - works, but mozillareality/reticulum/1.0.1/20210618144438 don't - always blocks login through Discord.

Hello, I've just become aware of this issue. Sorry to have missed it until now.

It seems that the recent Hubs Cloud update may have introduced a regression with Discord Auth in reticulum. The regression was fixed a while ago on HMC, but the code that was shipped to Hubs Cloud in February did not include that fix: Hubs-Foundation/reticulum#531

A new reticulum package that includes the fix can be used on your hubs cloud instance now, but it includes other changes that have not been tested on Hubs Cloud instances, so I can't guarantee it won't break in new, unpleasant ways.

If Discord Auth is a critical feature for you and you accept the risks of using an untested package, I believe you can (ssh into your server and) run:
bio svc load mozillareality/reticulum/1.0.1/20220311205847 --force
as root to load the (untested) package that includes the fix.

Note however -- This will lock your edit your hubs cloud reticulum package config to lock you to this package. To undo that, you will want to immediately restore your config file (/hab/sup/default/specs/reticulum.spec) back to normal:

ident = "mozillareality/reticulum"
group = "default"
bldr_url = "https://bldr.habitat.sh"
channel = "polycosm-stable-a"
topology = "standalone"
update_strategy = "none"
binds = []
binding_mode = "strict"
desired_state = "up"

[health_check_interval]
secs = 30
nanos = 0

If done correctly, this will fast-forward your hubs cloud instance to that reticulum package version, but you will still automatically download stable packages once they are available. After the next hubs cloud release, you should confirm everything looks normal.

Testing for this package commences next week and we aim to ship it (or a variant with any bugfixes) by April 1. If you can wait for Discord Auth that long, you do not need to take the steps above.

@aziliak
Copy link

aziliak commented May 2, 2022

@johnshaughnessy

Did this ever get tested/shipped? Having the Discord bot would be critical to several projects I am hoping to start working on.

@Bruguera-cbcat
Copy link

@aziliak
I tested it and I get it working but I'm stuck to autentificate from discord.

@JUGERNAUTUS
Copy link

Hy folks. So I am in the same boat and am trying to debug. I was able to find somethind (I think) but I need a little help with the resolution since Im new to hubs (reticulum specifically and elixir) and a bit green with AWS.

TL:DR Does anyone know how I can see reticulum logs in debug mode or monitor request/response to the public internet on AWS>

Basically when you click on the room link generated by the bot and then it asks for a discord authentication, after you authorize, discord sends a code and state params to your hubs cloud API server. Reticulum is expected to swap this code for an access token by hitting the discord token URL endpoint and replace this for an access token (https://discord.com/developers/docs/topics/oauth2). This access token is then supposed to be included in the header of all page requests to your hubs.

This functionality works fine for the mozilla hubs (hubs.mozilla.com) setup. The user is able to do a discord authentication and sign in using the Hubs Mozilla bot and if you check the request header, it contains an access token after you are redirected from the Mozilla Hubs API server.

Unfortunately if you are running a personal implementation of Hubs Cloud, the App server API endpoint seems to be unable to receive an access token. If you check the rerouting to the Hubs page after you authorize discord, the access token is missing in the header, hence hubs cloud again asks you to authorize and authenticate with discord

I can see that reticulum is making the request to discord in the syslog to swap the code for the access token. I can also see that the code has been swapped on discord's end, because if you try to do the swap with postman, it says 'invalid code' (it has been already swapped). Im not sure if reticulum is actually receiving the access token, and if it is, why it is not including it in the re routing request to the hubs page. Any suggestions ?

@JUGERNAUTUS
Copy link

Hy folks. So I am in the same boat and am trying to debug. I was able to find somethind (I think) but I need a little help with the resolution since Im new to hubs (reticulum specifically and elixir) and a bit green with AWS.

TL:DR Does anyone know how I can see reticulum logs in debug mode or monitor request/response to the public internet on AWS>

Basically when you click on the room link generated by the bot and then it asks for a discord authentication, after you authorize, discord sends a code and state params to your hubs cloud API server. Reticulum is expected to swap this code for an access token by hitting the discord token URL endpoint and replace this for an access token (https://discord.com/developers/docs/topics/oauth2). This access token is then supposed to be included in the header of all page requests to your hubs.

This functionality works fine for the mozilla hubs (hubs.mozilla.com) setup. The user is able to do a discord authentication and sign in using the Hubs Mozilla bot and if you check the request header, it contains an access token after you are redirected from the Mozilla Hubs API server.

Unfortunately if you are running a personal implementation of Hubs Cloud, the App server API endpoint seems to be unable to receive an access token. If you check the rerouting to the Hubs page after you authorize discord, the access token is missing in the header, hence hubs cloud again asks you to authorize and authenticate with discord

I can see that reticulum is making the request to discord in the syslog to swap the code for the access token. I can also see that the code has been swapped on discord's end, because if you try to do the swap with postman, it says 'invalid code' (it has been already swapped). Im not sure if reticulum is actually receiving the access token, and if it is, why it is not including it in the re routing request to the hubs page. Any suggestions ?

Guys, please check the below link. This resolution worked for me. Please see if it works for you as well

#302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jira-hubs-cloud P2 Address when able
Projects
None yet
Development

No branches or pull requests