TeamCity Agent error: Failed to publish artifacts: Authentication required - teamcity

I am using TeamCity 9.0.1. The TC server was just migrated from another machine, and now none of my build agents can publish artifacts. They show the following error in the build log:
[11:40:20][Publishing artifacts] Publishing using [WebPublisher]
[11:40:20][Publishing artifacts] Publishing using [ArtifactsCachePublisher]
[11:40:22][Publishing artifacts] Failed to publish artifacts: Authentication required
To login manually go to "/login.html" page
The server is behind an nginx reverse proxy. The server has LDAP, Built-in and Basic HTTP auth modules installed. How do agents authenticate with the server and why would it fail with this message? The builds seem to run just fine, they only can't upload the artifacts.

Are your agents running under a specific user account, or are you using System account for agent/server processes ?
If so, you might want to consider using a specific (service) user for the process, that way you can be sure that these are no restrictions from the build agent to the server communication.

Related

Error pushing package to Octopus Deploy from build script

As part of our TFS build I'm trying to push the latest package from our build pipeline to our Octopus Deploy instance. However I'm getting the following error.
I'm using a script task to execute the following octo push command.
octo push --package=mypackage.nupkg --overwrite-mode=OverwriteExisting --server=https://mycompany.octopus.app --user=myname#mycompany.com --pass=mypassword --debug --LogLevel=debug
Any ideas what's causing the error and how do I fix it?
It looks attempting to log in to the Octopus server using a username and password, but your instance isn't configured to accept that authentication type.
Is this pipeline pushing to an Octopus Cloud instance? If so, your authentication is via OctopusID, an external auth provider, rather than a username/password account on the Octopus instance itself.
As a general rule, using an API key is the recommended approach here, rather than username/password authentication.

Visual Studio webdeploy fail even when connection is validated?

I am trying to deploy my webapp VS2015 RC1 DNX 451. Even when I validate connection and run publish I get error
Severity Code Description Project File
Error Error Code: ERROR_USER_UNAUTHORIZED
Error More Information: Connected to the remote computer ("crocus.arvixe.com") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
Error Error: The remote server returned an error: (401) Unauthorized.
Googling the issue and even trying to view host forum just says make sure username and password is correct. I am getting nowhere trying various settings. Any ideas how to debug the issue?
I am using Arvixe.com as host.
You should contact Arvixe.com. They likely have some odd configuration on their servers but I would suspect they can help you resolve the issue.
Arvixe does not support Web Deploy anymore. Once they move you to their new servers Web Deploy won't be available to you. In Visual Studio you can set up a Publish with FTP instead of Web Deploy. If you're used to Web Deploy publishing your database changes, then you'll need to do those yourself with SQL scripts. Entity Frameworks has an option to produce a SQL script for a migration, so you can use that to publish your EF database changes.

Configure TFS Autodeploy to destination server via proxy server

I have a requirement to set up TFS build that auto deploys build deployment result to a remote server location/folder. In order to access this remote deployment folder, I would need to first access a proxy server A, and then from the proxy, I am then able to access machine where the deployment location/folder is located. How do I set this up on TFS please? How do I set up a build that on success makes the two jumps required to get to the deployment destination? Thanks in advance
You should not do this with the Build server. Its for compiling and testing your code. If you look at Release Management for TFS2013 you can configure a deployment to execute how you describe fairly easily.
http://nakedalm.com/installing-release-management-server-tfs-2013/

Sonatype Nexus Professional Proxy Configuration

Our project requires Nexus Professional to store and manage artefacts in a centralized repository hosted on Windows server. We were able to install Sonatype Nexus Professional in Windows workstation. However, I got stuck with Nexus' proxy configuration. A repository of type proxy is not able connect to the proxy server (i.e Proxy Blocked ).
Can some one help with configuration of proxy settings in Sonatype Nexus Professional in Windows?
Regs, Syam
This is HTTP error 407, indicating that your corporate http proxy server requires credentials but either none were supplied or incorrect ones were supplied.
Go to "administration/server" in the Nexus web UI, and configure both "default http proxy settings (optional)", and within that "authentication (optional)".
Most like your server is blocked to connect to the remote server via a proxy server or firewall.
Log into the server as the user running Nexus and confirm that you can ping the remote server first. Most likely that does not work.
Once you have fixed that it will either work or if required you will have to configure Nexus to connect via a proxy. This can be done on a Nexus global level as well as per repository.
I could ping to the https proxy server. We have configured the Proxy settings - Override the HTTP proxy setting of proxy repository configurations.
IAS server requires proxy authentication with error message "Access to the Web Proxy filter is denied". Hope this is due to proxy server configuration.
Error Message says:
Unexpected response code while executing GET method [repositoryId="central", requestPath="/.meta/prefixes.txt", remoteUrl="http://repo1.maven.org/maven2/.meta/prefixes.txt"].
Expected: "SUCCESS (200)". Received: 407 : Proxy Authentication Required
( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
Regards,
Syam
We have made the configuration updates as per your suggestion.
Some how my user credentials is getting locked out due to fact that login attempt failes multiple times at proxy server...
So will have to check with our manager & see if some thing can be done at the proxy server lever to over come the proxy authentication issue.
We will keep you updated. Ultimarly we are plaing for cenralies nexus server

Web Deploy 3.0 infuriating 401 error on publish

I can't seem to get a simple application to deploy to an IIS server that I am the administrator of. Here is the error message I get from VS2010 (domain name modified to protect the innocent):
------ Build started: Project: HelloWorldWeb, Configuration: Debug Any CPU ------
HelloWorldWeb -> D:\$Data\mhtest\HelloWorldWeb\bin\HelloWorldWeb.dll
------ Publish started: Project: HelloWorldWeb, Configuration: Debug Any CPU ------
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Account\Web.config into obj\Debug\CSAutoParameterize\transformed\Account\Web.config.
Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Start Web Deploy Publish the Application/package to http://www.myserver.com/MSDEPLOYAGENTSERVICE ...
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Error : Web deployment task failed.(Remote agent (URL http://www.myserver.com/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)
Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator.
Error details:
Remote agent (URL http://www.myserver.com/MSDEPLOYAGENTSERVICE) could not be contacted. Make sure the remote agent service is installed and started on the target computer.
An unsupported response was received. The response header 'MSDeploy.Response' was 'V1' but 'v1' was expected.
The remote server returned an error: (401) Unauthorized.
Publish failed to deploy.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
So far I have:
Installed Web Deploy 3.0 on the IIS server
Installed Web Management Service, although I don't think I'm attempting to use this yet, I want to do all this over port 80 for the time being (as opposed to 8172).
Ensured the service MsDepSvc is running as a user who is a member of Administrators
Ensured the credentials I use in VS2010 during deploy is a user who is a member of Administrators
Ensured the site and the application I've entered match what's already in existence on the IIS server
Other details:
The IIS server is remote, behind a firewall, not on my workstation's domain. I assume I should be doing this using Basic Auth, although I cann't find a way to specify this if it's not already the default.
If I open a browswer and navigate to http://www.myserver.com/MSDEPLOYAGENTSERVICE, sure enough I'm prompted for credentials. If I key in valid admin credentials, I get a blank screen - network tracing shows that the server responded with a 401.
I managed to get it working. I returned to a troubleshooting document:
http://www.iis.net/learn/publish/troubleshooting-web-deploy/troubleshooting-common-problems-with-web-deploy
About a third of the way down it references 401 errors, I read it more closely:
Trying to access Remote Agent Service as a non-administrator
SYMPTOMS
Microsoft.Web.Deployment.DeploymentException:
Could not complete the request to remote agent URL 'http://DestinationServer/msdeployAgentService'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
ROOT CAUSE
Remote Agent Service requires that the caller is a member of the Administrators group or from a domain account that has been added to the Administrators group. A local administrator which is not the built-in account will not work with the Remote Agent Service because of a bug in Web Deploy 2.0.
FIX/WORKAROUND
Provide administrative credentials
So, I didn't need to use "an" administrator account, I needed to use "the" Administrator account. I might have noticed this the first time if it didn't use a confusing double-negative and was clear about the bug also existing in the current version, i.e. 3.0 at the time of writing.

Resources