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

Dispatch Install, Deployment, and Config Support #2300

Closed
Hellboy7 opened this issue Jun 28, 2022 · 40 comments
Closed

Dispatch Install, Deployment, and Config Support #2300

Hellboy7 opened this issue Jun 28, 2022 · 40 comments
Labels
triaged Issue has been triaged

Comments

@Hellboy7
Copy link

Hellboy7 commented Jun 28, 2022

Describe the bug
This regards to dispatch slack configuration issue, I have updated the necessary details in slack plugins according to dispatch [slack documentation.] But I am getting multiple errors.

Errors:

Error from Slack app:
dispatch-conversionAPP 8:31 PM
Looks like you tried to run /dispatch-list-incidents in a conversation where the Dispatch bot is not present. Add the bot to your conversation or run the command in one of the following conversations:
Only visible to you
8:34
I see you tried to run /dispatch-list-participants in an non-incident conversation. Incident-specifc commands can only be run in incident conversations.
Only visible to you
8:39
I see you tried to run /dispatch-list-my-tasks in an non-incident conversation. Incident-specifc commands can only be run in incident conversations.
Only visible to you
8:39
I see you tried to run /dispatch-update-incident in an non-incident conversation. Incident-specifc commands can only be run in incident conversations.
Only visible to you
8:42
Looks like you tried to run /dispatch-list-incidents in a conversation where the Dispatch bot is not present. Add the bot to your conversation or run the command in one of the following conversations:

Error from docker backend
ERROR:dispatch.plugins.dispatch_slack.service:SlackError. Response: {'ok': False, 'error': 'channel_not_found'} Endpoint: conversations.info kwargs: {'channel': 'C03MFS2LV9Q'}
ERROR:dispatch.plugins.dispatch_slack.service:SlackError. Response: {'ok': False, 'error': 'channel_not_found'} Endpoint: conversations.info kwargs: {'channel': 'C03MFS2LV9Q'}

@Hellboy7
Copy link
Author

Screenshot 2022-06-28 at 8 53 46 PM

@Hellboy7
Copy link
Author

Screenshot 2022-06-28 at 8 53 59 PM

@Hellboy7
Copy link
Author

Hi @mvilanova
Thanks for the response in the gitter,
Can you check above issue and screenshots please and help me to sort the problem?
If you are ok with video call I can set up the meeting, it would be great helpful. Let me know your preference time if it is ok for you?

@mvilanova
Copy link
Contributor

@Hellboy7 what the error message is telling you is that the Slack App you created and deployed in your Workspace is not a member of the conversation where you're trying to run the slash commands. If everything is configured correctly, Dispatch should create an incident Slack channel and add your Slack app to it, so you can run its slash commands.

@mvilanova
Copy link
Contributor

The reason why we don't allow you to run slash commands that are built to interact with the incident in non-incident-related channels is because Dispatch needs to know the Slack channel id linked to the incident.

@mvilanova mvilanova added the triaged Issue has been triaged label Jun 28, 2022
@Hellboy7
Copy link
Author

Can you help me on the configuration part to sort this issue? I can set-up call if you are ok?
I tried my best to config and troubleshoot the error but I failed.

@mvilanova
Copy link
Contributor

Let's give it a try here first if you don't mind. Please share the steps you followed to setup Dispatch and the app/ bot in your Slack workspace.

@Hellboy7
Copy link
Author

Hellboy7 commented Jun 30, 2022

Hi @mvilanova

I guess screwed up entire dispatch docker. I am planning to start fresh install from scratch. Just guide me step by step procedure to install. Ill do it myself.

Initially, I installed dispatch from below mentioned github repo is that correct way?
https://github.com/Netflix/dispatch-docker

Then what is this github repo for ? I got confused when I saw below repo.
https://github.com/Netflix/dispatch

which one to use to install dispatch?

@mvilanova
Copy link
Contributor

It depends on whether you want to run it in a container or somewhere else like an AWS instance. If you look at the docker-compose.yml file here, you'll see that docker will build the core image with the source code in https://github.com/Netflix/dispatch

@Hellboy7
Copy link
Author

Hellboy7 commented Jun 30, 2022

@mvilanova
I have installed in docker on my local machine and as well in AWS EC2 Instances. I am working on both the places.
Ill do fresh install in AWS as well, how to run install dispatch using this repo > https://github.com/Netflix/dispatch.

@Hellboy7
Copy link
Author

My current dispatch version in my local machine is > "dispatch, version 0.1.0.dev0". is this latest version?

@mvilanova
Copy link
Contributor

mvilanova commented Jun 30, 2022

how to run install dispatch using this repo > https://github.com/Netflix/dispatch

If this was a question, the answer is there's no script to install it. You need to checkout the source in your CI/ CD pipeline.

My current dispatch version in my local machine is > "dispatch, version 0.1.0.dev0". is this latest version?

Yes, ignore the version number. https://github.com/Netflix/dispatch.git#latest will always be the latest stable version.

@Hellboy7
Copy link
Author

ok once we deploy code in AWS, how do we start the dispatch? In docker, we do docker-compose to start the dispatch.

@mvilanova
Copy link
Contributor

mvilanova commented Jun 30, 2022

You can start the web server by running the following command

exec /apps/sirtdispatch/bin/dispatch server start dispatch.main:app --workers 6 --host 127.0.0.1 --port 7101 --proxy-headers

and the scheduler by running

exec /apps/sirtdispatch/bin/dispatch scheduler start

Adjust the path as necessary.

@mvilanova mvilanova changed the title Dispatch Slack Config Support Dispatch Install, Deployment, and Config Support Jun 30, 2022
@Hellboy7
Copy link
Author

Hellboy7 commented Jul 1, 2022

Hi @mvilanova

Thanks for your continuous support, and I appreciate that.

I did a fresh installation of dispatch in the AWS EC2 instance. Installation is done through the docker image repo (https://github.com/Netflix/dispatch-docker) with an example Postgres SQL data dump for testing. Post that, I have configured slack for dispatch as per instructions in the docs (https://hawkins.gitbook.io/dispatch/administration-guide/incident/plugins/configuring-slack). This time it worked and whenever I create incident it automatically creates new slack channel for the incident. I have tested few slash commands which worked fine. Need to do further testing.

Now I need support on to understand few things, I have created Application load balancer in AWS and mapped to dispatch server. I am able to access dispatch through application load balancer link. But, In some instances like in slack channel hyperlinks points to "localhost:8000". Another scenario is after creating incident below "Ticket" section in the same page where hyperlink points to "localhost:8000" and I want that to redirect that to my application load balancer link for example (http://dispatch.com). How to configure that, can you guide me on that? Check the screenshots for reference.

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 1, 2022

Screenshot 2022-07-01 at 10 32 26 AM
Screenshot 2022-07-01 at 9 39 49 AM

@mvilanova
Copy link
Contributor

mvilanova commented Jul 1, 2022

Looks like you did not define DISPATCH_UI_URL in your .env file and Dispatch is using the default, which is http://localhost:8000. See https://hawkins.gitbook.io/dispatch/administration-guide/server#dispatch_ui_url

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 4, 2022

Hi @mvilanova

I read through the above mentioned blog post, and some of the info I was able to digest with my basic knowledge but, I felt it was complex.

After reading the blog, one thing I noticed document says it should be done during the build time. But In my case, I have already installed the "dispatch" in AWS EC2 instance.

Is it possible to modify now? If yes, how to do it? and in which docker image ("dispatch_web_1" or "dispatch_core_1") we should configure the "DISPATCH_UI_URL"? Refer Screenshots.

Screenshot 2022-07-04 at 6 34 18 PM

I searched ".env" file in the both docker images of "dispatch_web_1" & "dispatch_core_1" under the file locations which is mentioned below. I could not find any such file with extenion of ".env". where exactly this file is located? Refer Screenshots.

Screenshot 2022-07-04 at 6 45 52 PM

or Should I install from the beginning?

@mvilanova
Copy link
Contributor

That's correct. The .env file needs to be in the same directory as the install.sh Bash script when you run the script to build the docker images. We provide a sample one here.

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 7, 2022

Hi @mvilanova

As suggested, I have created new ".env" file in the "dispatch-docker" directory with the content mentioned below:

Screenshot 2022-07-07 at 11 17 20 AM

Post that, I executed the "./install.sh" but finished in error. Please refer to the screenshot.

Screenshot 2022-07-07 at 11 20 09 AM

Not able to rectify the error, what causing the issue.

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 7, 2022

@mvilanova
I fixed the issue by myself after so much research on it. still if you want comment. Please feel free to correct me.

@mvilanova
Copy link
Contributor

What was the issue @Hellboy7?

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 7, 2022

Check the above screenshot:

ERROR: error fetching: fatal: couldn't find remote ref latest
: exit status 128

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 7, 2022

Hi @mvilanova

This is another error faced while working with dispatch CLI for database.
Link: https://hawkins.gitbook.io/dispatch/administration-guide/cli

I was playing around with dispatch database --help

I executed the command dispatch database heads but I got below error.

Screenshot 2022-07-07 at 9 38 27 PM

@mvilanova
Copy link
Contributor

The message in the screenshot is not an error, but a warning.

How did you fix the following error?

ERROR: error fetching: fatal: couldn't find remote ref latest : exit status 128

@Hellboy7
Copy link
Author

Hellboy7 commented Jul 8, 2022

Hi @mvilanova

In docker-compose.yml file I changed the build:context url from https://github.com/Netflix/dispatch.git#latest to https://github.com/Netflix/dispatch.git which worked fine. is something wrong with that or this is not the best practice? Refer to screenshot.

Screenshot 2022-07-08 at 9 24 49 AM

Additionally, I need support on a few things:

  1. Few dispatch CLI commands are not working and it shows some warnings like "doesn't match supported versions!": Refer to screenshot.

Screenshot 2022-07-08 at 9 19 43 AM

  1. Is possible to change the Org name "default" to any other name or can we delete the Org "default"? Refer to screenshot.
    Screenshot 2022-07-08 at 9 21 44 AM

  2. How to reset a user password? "User management stuff" like user creation etc.

@rlevit
Copy link

rlevit commented Jul 8, 2022

+1 for being able to delete the default org entirely or rename it so creating a new org wouldn't need to be necessary.

@mvilanova
Copy link
Contributor

Few dispatch CLI commands are not working and it shows some warnings like "doesn't match supported versions!": Refer to screenshot.

See my comment here: #2300 (comment)

Is possible to change the Org name "default" to any other name or can we delete the Org "default"? Refer to screenshot.

No, not at the moment.

How to reset a user password? "User management stuff" like user creation etc.

If you're using basic auth, you can use CLI command dispatch user update

@Hellboy7
Copy link
Author

Hi @mvilanova

Thanks for the continuous support and information.

#2300 (comment)

I read the above comments. I understood bit of it It is not error, and it is warning. But is there anyway to solve those warnings. Because, In docker-compose.yml when I use git#latest in the build:context URL place. It fails with warning signs and does not proceed further.

Refer to the second screenshot for warning sign details: #2300 (comment)

The reason why I ask above question repeatedly, because multiple times I update .env file to test few things. So post that I run ./install.sh script in the dispatch-docker folder which updates env variables for me. But last few times it failed with URL of "https://github.com/Netflix/dispatch.git#latest" and it did not update env variables and also ./install.sh script stopped with ERROR: error fetching: fatal: couldn't find remote ref latest : exit status 128. So I started using to URL "https://github.com/Netflix/dispatch.git" which worked successful and updated the env variables. Any workaround to sort this problem to use git#latest.

@Hellboy7
Copy link
Author

Hi @mvilanova

Does dispatch support OAUTH through an app-registration on Azure AD? Because, our org is moving to Azure AD from GCP (G-Suite).

@mvilanova
Copy link
Contributor

@Hellboy7 again, it's a warning, not an error and it's not impacting your ability to run Dispatch commands successfully. For example, in #2300 (comment) you ran dispatch database heads and got the result from running that command after the warning. In #2300 (comment), you ran dispatch database populate, which is not a valid command. Please, run dispatch database --help to see available commands.

These warnings have nothing to do with thelatest error you are getting. Looks like the latest tag was not created correctly in the origin during the last release. I'll get it fixed, which will make your docker building error go away.

@mvilanova
Copy link
Contributor

@Hellboy7 latest tag should work again. Let me know if that's not the case.

Dispatch supports basic login/password, PKCE, and custom auth providers. PKCE is the way to go for your use case. This article seems like a good start: https://docs.microsoft.com/en-us/azure/active-directory/saas-apps/openidoauth-tutorial

@Hellboy7
Copy link
Author

Hi @mvilanova
As suggested, I have update the URL with latest tag in the docker-compose.yml file and executed the ./install.sh script.
Screenshot 2022-07-12 at 9 22 38 PM
But, I got following warnings/errors. Refer screenshot.
Screenshot 1
Screenshot 2022-07-12 at 9 21 45 PM
Screenshot 2
Screenshot 2022-07-12 at 9 22 03 PM

@mvilanova
Copy link
Contributor

I reverted the changes in #2304, which caused this issue. You'll need to remove the latest label to leverage the changes. Can you run the script and let me know if it is resolved?

@Hellboy7
Copy link
Author

Hi @mvilanova
Thanks for the fix, That worked fine with minor warnings!!!

I am not able to switch the Org in the Dispatch UI!!!

Screenshot 2022-07-13 at 10 06 11 AM

I am able to access the projects by changing the Project names in URL.

Project 1: https://dispatch-netflix[.]com/default/dashboards/incidents
Project 2: https://dispatch-netflix[.]com/sprinklr/dashboards/incidents

@mvilanova
Copy link
Contributor

Known problem. Working on a fix.

@Hellboy7
Copy link
Author

Thank you so much for the support so far !!!
I am currently working SSO integration with Azure AD. I will update my journey on this if it was successful and document it. It may be useful for others in the community.

@Hellboy7
Copy link
Author

Hi @mvilanova
I see new pull requests, How to update this? Same procedure like running the script "./install.sh" or any different ways to update the dispatch with latest changes done in the repo?

@mvilanova
Copy link
Contributor

@Hellboy7 you can run the install script when a new release goes out or remove #latest from here and run the install script any time you want to pull any new changes.

@mvilanova
Copy link
Contributor

@Hellboy7 all good here? Can we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Issue has been triaged
Projects
None yet
Development

No branches or pull requests

3 participants