locked
Issue integration Team Foundation Server 2015 with slack service RRS feed

  • Question

  • Hi,

    In my society we have a Team Foundation Server 2015 and we want tu use a sevice hook for slack. I have followed procedure : https://www.visualstudio.com/en-us/docs/integrate/get-started/service-hooks/services/slack

    When I use test button, message is correctly send to slack : "Jamal Hartnett has created a pull request merge commit" but when my team do a pull request I have an error message in service hook :

    System.Net.Http.HttpRequestException: Une erreur s'est produite lors de l'envoi de la demande. ---> System.Net.WebException: Le nom distant n'a pas pu être résolu: 'hooks.slack.com' à System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) à System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar) --- Fin de la trace de la pile d'exception interne --- à System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) à Microsoft.VisualStudio.Services.ServiceHooks.Common.HttpActionTask.<RunAsync>d__8.MoveNext()

    Service response :

    Because of an error during the sending of the request, no answer was returned. 
    Error (s):

        An error occurred during the sending of the request.
       The distant name was not able to be solved: ' hooks.slack.com '

    Verify that there is no rule of firewall which blocks the requests intended for the selected point of ending.

    Our TFS server is behind a corporate proxy to access to internet.

    I have already set "web.config" file with <defaultProxy> for Web Services (C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services) and this make test button work. But not for all.

    Thank you in advance for your help

    Chris

    Monday, January 16, 2017 1:42 PM

Answers

  • Hi,

    Thx a lot Limitxiao, with all these advises I can now push informations to slack from my TFS server.

    This subject can be closed.

    Chris

    • Marked as answer by chrisngv77 Tuesday, January 31, 2017 8:09 AM
    Monday, January 30, 2017 9:35 AM

All replies

  • Hi chrisngv77,

    Thank you for posting here.

    I tried to reproduce your issue, the slack works well in my machine. You said the service hook worked well when you click test, but if you create a pull request, did the service hook work? And I suggest that you could:

    1. Change the trigger events to others like: create work item, code check in, then check if the web hook work after you do the corresponding operation.

    2. As the log said, check if the firewall or proxy block out the request.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 17, 2017 2:44 AM
    Moderator
  • Hi Limitxiao,

    Thx for your answer. I have change trigger and I'm waiting for a new push in y team.

    But I thing that the problem could be caused by our corporate proxy. Do you know all places where I can set it in TFS config ?

    Tuesday, January 17, 2017 8:17 PM
  • Hi chrisngv77,

    Did you configure the TFS proxy on your corporate proxy server? Did the hook work without the corporate proxy? TFS Proxy is used to store the cache of version control, this issue is related to your corporate proxy, so there is no place to set about your corporate in TFS. Please check if the proxy block out the request.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 18, 2017 8:52 AM
    Moderator
  • Hi Limitxiao,

    When you say : "TFS Proxy is used to store the cache of version control, this issue is related to your corporate proxy, so there is no place to set about your corporate in TFS"

    I have already changed the web.config file in C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services on element <defaultProxy> to set my corporate proxy. This changing allows me to make the "Test" button works. Then I thought there was an other setting to do.

    I don't use TFS proxy system.

    Wednesday, January 18, 2017 3:43 PM
  • Hi chrisngv77,

    I am sorry I misunderstand your meaning before. After you change the trigger, did this issue still happen? And please check if you could find some error log about this issue in event viewer.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 19, 2017 9:42 AM
    Moderator
  • Hi Limitxiao,

    After changing trigger, issue stay the same. There isn't any log in event viewer for this concern.

    That I don't understand it's : I don't understand why I can send a test message (with test button) from TFS to slack and why by trigger, it doesn't work ?

    Edit:

    I have tested to send a message from my TFS server directly to slack like (using Postman):

    POST https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX Content-type: application/json { "text": "This is a line of text.\nAnd this is another one." }

    and it's work fine

    Then, I think, a config is missing in TFS to allow it to use my corporate proxy. But where ???

    Best Regards,

    Chris



    • Edited by chrisngv77 Monday, January 23, 2017 2:13 PM edit
    Monday, January 23, 2017 8:53 AM
  • Hi chrisngv77,

    I am sorry that I do not have proxy to reproduce your issue. But I suggest that you could try to add the proxy setting to the TfsJobAgent.exe.config and web.config in message queue:

     C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\TFSJobAgent\TfsJobAgent.exe.config

    C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Message Queue

    Then restart the TFSJobagent service.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 24, 2017 9:16 AM
    Moderator
  • Hi,

    I have added this configuration:

    <defaultProxy>
        <proxy usesystemdefault="True" proxyaddress="my proxy address" bypassonlocal="True"/>
     </defaultProxy>

    in 

    C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Web Services\web.config

    C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\TFSJobAgent\TfsJobAgent.exe.config

    C:\Program Files\Microsoft Team Foundation Server 15.0\Application Tier\Message Queue\web.config

    and restart the only TFS service on my server.

    always same issue !

    Wednesday, January 25, 2017 9:55 AM
  • Hi chrisngv77,

    Please also try to clean the cache on the following path:

    1.Clean the Cache folder on Server machine. The folder path is:
    C:\ProgramData\Microsoft\Team Foundation\Web Access\Cache_v11.0

    3.After cleaned, on Server machine, click Start and select Run… to open the dialog box,
    then input iisreset.exe and click OK, wait it run completely.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 26, 2017 6:49 AM
    Moderator
  • Hi,

    Thx a lot Limitxiao, with all these advises I can now push informations to slack from my TFS server.

    This subject can be closed.

    Chris

    • Marked as answer by chrisngv77 Tuesday, January 31, 2017 8:09 AM
    Monday, January 30, 2017 9:35 AM
  • Hi Chris,

    Glad to know that you have resolved this issue .Would you please mark the reply as the answer? So it
    would be helpful for other members who meet the same issue as yours.
    Have a nice day.

    Best Regards

    Limitxiao Gao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 31, 2017 1:34 AM
    Moderator