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

Getting 404 on endpoints when using the docker image V2.0.2 #61

Closed
1 task done
twittyc opened this issue Apr 9, 2018 · 6 comments
Closed
1 task done

Getting 404 on endpoints when using the docker image V2.0.2 #61

twittyc opened this issue Apr 9, 2018 · 6 comments

Comments

@twittyc
Copy link

twittyc commented Apr 9, 2018

Prerequisites

Description

Getting 404 on endpoints when using the docker image V2.0.2

Steps to Reproduce

  1. Navigate to http://host:port/v2

Hey guys, the documentation is a little confusing on what the appropriate endpoint is for this application. When using the docker image, I am unable to hit the endpoints. I'm getting a 404. I tried http://host:port/v2 and http://host:port/v2/Connector. Also I wasn't able to hit the swagger-ui. I was hoping for some clarification on this. Thanks!

@jnogol
Copy link
Collaborator

jnogol commented Apr 9, 2018

Yep, we've found an odd behaviour, and the host you send the requests to needs to be the same as the Host field specified in the configuration file. So, in the Docker case, you need to set PROM2TEAMS_HOST as the container IP. For example:

$ docker run -it -d --name prom2teams -e PROM2TEAMS_CONNECTOR="myConnectorURL" -e PROM2TEAMS_HOST="172.17.0.2" -p 8089:8089 idealista/prom2teams:2.0.2

Now you could navigate to http://172.17.0.2:8089/ and you'll see the swagger interface. Sending alarms to the endpoints will work as expected.

We will take a look and try to improve this behaviour as soon as possible. Feel free to contribute sending us a PR.

Regards,
Jose

@twittyc
Copy link
Author

twittyc commented Apr 9, 2018

I'm trying to run this on Kubernetes. So ideally the app doesn't care what the hostname is if it's running in a container. As Kubernetes dynamically assigns IP addresses to containers when they are created and uses service manifests to allow the containers to communicate to each other using a DNS name. I can try to take a look.

@a-zen
Copy link

a-zen commented Apr 10, 2018

Ah this explains it. I was wondering where this odd behaivour came from.

Gkrlo added a commit that referenced this issue Apr 10, 2018
Gkrlo added a commit that referenced this issue Apr 11, 2018
#61: Fix getting 404 (SERVER_NAME removed from flask app)
@jnogol
Copy link
Collaborator

jnogol commented Apr 11, 2018

Hi @a-zen, @twittyc,

Prom2teams v2.0.3 was just released. Please check if it solves this issue and if not so, provide us with feedback.

Regards,
Jose

@twittyc
Copy link
Author

twittyc commented Apr 11, 2018

Hey guys, It looks good. I'm able to hit both api versions and the Swagger UIs. Thanks for the quick turnaround on this.

@jnogol jnogol closed this as completed Apr 17, 2018
@evidyasagar
Copy link

Prerequisite:
tried deploying the docker container using latest one, however, i am getting 405 on endpoints when using the docker image V2.0.3. and teams should get integrated with alert manager

Steps to reproduce:
Tried deploying latest prom2teams tool of 2.0.3 version on one of the vm and returning with 405 error.
2021-04-12 13:48:50,852 - werkzeug - INFO - 172.17.0.1 - - [12/Apr/2021 13:48:50] "GET /v2/Connector HTTP/1.1" 405 -
I get this when i try to curl the prom2teams link
curl http://localhost:8089/v2/Connector.
{"message": "The method is not allowed for the requested URL."}

Also, I tried but I wasn't able to hit the swagger-ui. Would you mind providing some solution around this new version if there's a fix already in place. Thanks!

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

No branches or pull requests

4 participants