Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Connection Failed with Teamcity 2017.1.1 #79

Open
stallion2076a opened this issue May 17, 2017 · 19 comments
Open

Connection Failed with Teamcity 2017.1.1 #79

stallion2076a opened this issue May 17, 2017 · 19 comments

Comments

@stallion2076a
Copy link

Helllo ,

I am unable to connect my teamcity to Hichat , it says connection failed

image

Just wondering if I got the URL right

image

@andyofengland
Copy link

Did you ever get a resolution to this at all?

@BenedekFarkas
Copy link

BenedekFarkas commented Jun 26, 2017

The URL (in case you're using HipChat Cloud) should be https://api.hipchat.com/v2/.

@andyofengland
Copy link

I've tried that but I keep getting "Connection Failed". Are there any specific firewall exceptions that are needed from the server? Or is it just server ==> hipchat on 80?

@BenedekFarkas
Copy link

BenedekFarkas commented Jun 26, 2017

I don't think so. Btw the token needed for the connection needs to be assigned to a user, since account-wide tokens don't work with the v2 API (only v1). You need to set up a user (or use an existing one, like your own, if you're an admin, but I have a separate one) for sending notifications, then log in with it and go to https://yourdomain.hipchat.com/account/api and create an API token with the Send notification permission level.

@khaljimbo
Copy link

Have you been able to get this working? I've tried everything including the ideas suggest on #52 and #61 and it's still not working.

@webmastir
Copy link

@khaljimbo I had a similar issue not too long ago. It ended up being the result of an expired access token.
I highly doubt this is your problem, but it might be worth checking.

@BenedekFarkas
Copy link

@khaljimbo works for me with the token generated as described in my previous comment.

@khaljimbo
Copy link

I still can't get it to connect, I've created 3 different tokens.

One with every permission
One with only the 3 in the last comment
One with everything from the hipchat administrator.

I still can't seem to get it to connect. Really want to use this enable our CI journey even better.

@stallion2076a
Copy link
Author

It was the url that was wrong , after I fixed it it worked fine

@khaljimbo
Copy link

@stallion2076a can you share your URL?

I am using https://api.hipchat.com/v2

I am using the Octopus Deploy hipchat notifier too which uses the same api url and that is working fine. I am also using TeamCity 2017.1.2

@khaljimbo
Copy link

khaljimbo commented Sep 27, 2017

So I was able to get it to connect by adding /rooms onto the end of the URL. I get a connection successful message. However it is not showing any rooms in the drop down when I click to choose them, the list just stays blank even after reloading and refreshing the page.

I've got it completely working now. All I needed was the / on the end on v2.

@webmastir
Copy link

@khaljimbo Ah! Glad it's fixed. I had to do the same thing as well.

@flocsy
Copy link

flocsy commented Jan 28, 2018

I can't make it work. I tried it both with https://api.hipchat.com/v2, https://api.hipchat.com/v2/rooms, https://mydomain.hipchat.com/v2/, https://mydomain.hipchat.com/v2/rooms. My TC version is: 2017.2.1 (build 50732)

@BenedekFarkas
Copy link

@flocsy working for me on the same TC version. The URL should be https://api.hipchat.com/v2/. Have you got the token set up correctly (as discussed above)? If you get a "Connection successful", you still need to set it up for your TC projects.

@flocsy
Copy link

flocsy commented Jan 31, 2018

URL: https://api.hipchat.com/v2/, token from https://mysubdomain.hipchat.com/account/api (Send Notification scope with my user) and I get "test connection" (tried before and after save) just gives me "Connection failed". I have no idea what's the problem, there's no indication at all.

When I click on the button it starts an ajax call to (fake host, token :)

http://my-tc.example.com:8901/configureHipChat.html?test=1&apiUrl=https%3A%2F%2Fapi.hipchat.com%2Fv2%2F&apiToken=abcdeflwef3efg23ef23ewfvfdsad23wesdf3w3wer32

That gives a 400 error

@BenedekFarkas
Copy link

BenedekFarkas commented Feb 2, 2018

I just realized that my token has both Send Notification and View Group scope. If you only have View Group, then the connection test will be successful, but it won't be able to send notifications.

So you need both of those scopes for connection test to be successful and be able to assign HipChat rooms to TeamCity projects and then actually send notifications.

FYI it will only be able to access your public rooms and private ones that the user (to whom the token belongs) is invited to.

EDIT: It's actually in the readme. oops

@flocsy
Copy link

flocsy commented Feb 4, 2018

na így már működik!

@BenedekFarkas
Copy link

Remek! :D

@Funbit
Copy link

Funbit commented Jun 13, 2018

OMG, I've spent almost an hour trying to find out why connection is failed.
@BenedekFarkas 's answer is correct, both scopes are required for connection test to be successful! Thanks!

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

No branches or pull requests

7 participants