microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
132 stars 57 forks source link

getaddrinfo ENOTFOUND building errror for On-Prem TFS2015 #238

Closed glennwester closed 8 years ago

glennwester commented 8 years ago

Followed the On Prem Server guide verbatim https://github.com/Microsoft/vso-agent/blob/master/docs/onprem.md

./run.sh Enter alternate username > Glenn Wester Enter alternate password > Enter server url > http://desktop-o5d5tlk.local:8080/tfs/ Enter agent name (enter sets Glenns-MacBook.local) > previewMacbook1 Enter agent pool name (enter sets default) > Enter force basic (enter is false) > true successful connect as undefined Retrieved agent pool: Default (1)

I am able to get the agent to connect correctly and it shows in the 'Agent Pools' in green as a connected agent, however when I try to build a Xamarin.iOS app I get the following error:

[Error] 2016-03-02T18:10:28.080Z: getaddrinfo ENOTFOUND desktop-o5d5tlk desktop-o5d5tlk:8080

When I specify '.local' in Enter server url > http://desktop-o5d5tlk.local:8080/tfs/, this is not showing in the two listed domains in the error line above. From my Mac I cannot connect using desktop-o5d5tlk:8080, it must be desktop-o5d5tlk.local:8080 but it seems that being ignored during building.

bryanmacfarlane commented 8 years ago

Can you supply some context around that single error line? Is it when it's rnning the xamarin task or before it runs the xamarin task? Does it get code and then fail in the xamarin task? Trying to figure out if I should route to who owns the xamarin task.

The other possibility is it's failing when it's trying to download the tasks up front (before get code). If that's the issue, then it's likely due to something that was already fixed in the preview 0.5.x version of the agent. Notice how you connect to the queue using .local but the url it can't connect to does not have .local. The reason is the server sends the url it knows itself by (admin console notification url) in the job message. The fix in the 0.5.x agent was to use the hostname from the url you connected to (linux/OSX agent owns how it knows the server by) and the path from the url sent from the server in the job message.

While you could change the notification url in the admin console to have .local - that wouldn't be a good idea because then you couldn't use some mail links etc... from the server or windows boxes. This is the reason we made that change in the 0.5.x agent.

csternbu commented 8 years ago

got the same problem. working with a ubuntu against TFS 2015 repository it seems that although you define in Enter server url > "http://tfs2015.local:8080/tfs, it does not add it when it gets the path from tfs. when it connects to tfs and gets all params for setup it will not be taken . In my log i see "type":"TfsVersionControl","url":"http://tfs2015:8080/tfs/TFS2015-TEST/", and then getaddrinfo ENOTFOUND tfs2015 tfs2015:8080.

bryanmacfarlane commented 8 years ago

This is actually well understood. We also test and self-host (agent runs the builds that builds itself) on many Linux variants and OSX daily.

There was a bug fix in the agent to handle this case. What version of the agent do you have?

bryanmacfarlane commented 8 years ago

Dupe of https://github.com/Microsoft/vso-agent/issues/190

csternbu commented 8 years ago

I got it to work finally. added the local network in conf file here is what i did: added in /etc/resolve.conf this line domain .local
and in /etc/network/interfaces dns-search .local got the sources from TFS directly onto ubuntu now,
have a issue now with :
Forbidden(403) - Access denied: {user} does not have write permissions for orchestration plan Permissions of {user} are properly defined in the Agent Pool

Thanks Bryan, your comments are helpful

nigurr commented 8 years ago

@csternbu "Forbidden(403) - Access denied: {user} does not have write permissions for orchestration plan" - this shouldn't be a problem. can be ignored or while configuring the agent choose "force basic = false"