Setting up Self Hosted Agent on Windows machine : WRITE ERROR: An error occurred: Not configured - azure-devops

Trying to set up Self Hosted Azure DevOps Agent on the windows machine.
Pre-requisites are verified and hold good - Windows 10 machine, Powershell 5.1, .NET Framework 4.7. PAT is properly configured, the Agent Administrator role is assigned to the user. When run.cmd is executed, the message appears "the error occurs: Not configured"
When checked the logs under _diag folder, this is a snapshot of the error
[2020-04-16 18:47:26Z INFO ConfigurationManager] LoadSettings
[2020-04-16 18:47:26Z INFO ConfigurationStore] IsConfigured()
[2020-04-16 18:47:26Z INFO ConfigurationStore] IsConfigured: False
[2020-04-16 18:47:26Z INFO ConfigurationManager] Is configured: False
[2020-04-16 18:47:26Z ERR Terminal] WRITE ERROR: An error occurred: Not configured
[2020-04-16 18:47:26Z ERR AgentProcess] System.InvalidOperationException: Not configured
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.LoadSettings()
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Program.MainAsync(IHostContext context, String[] args)
Appreciate to receive any inputs

config.cmd must be be ran and complete successfully before running run.cmd

In my case, the agent was corrupted. the config.cmd was missing entirely. Reinstalling the agent resolved the issue.

Related

Unable to start keycloak 19 in production mode

we have keycloak 14 connected to an Amazon RDS Aurora PostgreSQL and now trying to update to Keycloak 19 with the same DB but is failing with the below error
2022-09-20 09:54:56,959 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2022-09-20 09:54:56,960 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: ISPN000324: Cache 'realms' is in 'STOPPING' state and this is an invocation not belonging to an on-going transaction, so it does not accept new invocations. Either restart it or recreate the cache container.
Any help would be appreciated.

Connect static agents to dynamic jenkins (Jenkins running in OpenShift)

We are running Jenkins in Open-shift and its fully up and running. Now, when trying to add a static agents we are getting the 404 not found error.
Agent startup script:
java -jar remoting_dslave.jar -jnlpUrl http://xxx-xxx-xxx.apps.ocp1.uat.dbs.com/computer/xxxxxxxx2a/jenkins-agent.jnlp -secret xxxxxxxxxxxxxxxxxxxxxx -workDir "/dcifent/JenkinsSlaves/ci3_dynamicSlave"
Getting the below error:
WARNING: Connection refused (Connection refused)
Jun 07, 2022 11:17:23 AM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: http:/xxxxxxxxx.apps.ocp1.uat.dbs.com/ provided port:8080 is not reachable
java.io.IOException: http://xxxxxxxxx.apps.ocp1.uat.dbs.com/ provided port:8080 is not reachable
at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:311)
at hudson.remoting.Engine.innerRun(Engine.java:689)
at hudson.remoting.Engine.run(Engine.java:514)
Creted new router in OpenShift for port 8080 updated the startup script as below
java -jar agent.jar -jnlpUrl http://routefor8080.apps.ocp1.uat.dbs.com/computer/xxxxxxxx2a/jenkins-agent.jnlp -secret xxxxxxxxxxxxxxxxx -workDir "/dcifent/JenkinsSlaves/ci3_dynamicSlave"
Getting the different error now.
Failed to obtain http://routefor8080.apps.ocp1.uat.dbs.com/computer/xxxxxxxx2a/jenkins-agent.jnlp?encrypt=true
java.io.IOException: Failed to load http://routefor8080.apps.ocp1.uat.dbs.com/computer/xxxxxxxx2a/jenkins-agent.jnlp?encrypt=true: 404 Not Found
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:517)
at hudson.remoting.Launcher.run(Launcher.java:345)
at hudson.remoting.Launcher.main(Launcher.java:296)
Waiting 10 seconds before retry
How can i connect static agents to dynamic Jenkins, can someone please help?

Azure DevOps agent configuration successfully connects to the server, but then fails with "Error VS30063: You are not authorized to access..."

I have installed Azure DevOps agent on my laptop and am trying to configure it. It does connect to the Azure server, and I see it on the server appearing in the list of agents, but then config.cmd fails with error VS30063:
PS C:\agent> ./config.cmd
>> Connect:
Enter server URL > https://myazuredevops.com
Enter authentication type (press enter for PAT) >
Enter personal access token > ****************************************************
Connecting to server ...
>> Register Agent:
Enter agent pool (press enter for default) >
Enter agent name (press enter for WINDOWS-NKCBPLC) >
Scanning for tool capabilities.
Connecting to the server.
Enter replace? (Y/N) (press enter for N) > y
Successfully replaced the agent
Testing agent connection.
VS30063: You are not authorized to access https://myazuredevops.com.
The log file contains the following lines:
......
[2020-08-26 10:56:13Z INFO ConfigurationManager] Agent server url resolve by server: 'https://myazuredevops.com/'.
[2020-08-26 10:56:13Z INFO ConfigurationStore] Saving OAuth credential # C:\agent\.credentials
[2020-08-26 10:56:13Z INFO ConfigurationStore] Credentials Saved.
[2020-08-26 10:56:14Z INFO Terminal] WRITE LINE: Testing agent connection.
[2020-08-26 10:56:14Z INFO ConfigurationStore] HasCredentials()
[2020-08-26 10:56:14Z INFO ConfigurationStore] stored True
[2020-08-26 10:56:14Z INFO CredentialManager] GetCredentialProvider
[2020-08-26 10:56:14Z INFO CredentialManager] Creating type OAuth
[2020-08-26 10:56:14Z INFO CredentialManager] Creating credential type: OAuth
[2020-08-26 10:56:14Z INFO RSAEncryptedFileKeyManager] Loading RSA key parameters from file C:\agent\.credentials_rsaparams
[2020-08-26 10:56:14Z INFO VisualStudioServices] Starting operation Location.GetConnectionData
[2020-08-26 10:56:14Z WARN VisualStudioServices] Authentication failed with status code 401.
.....
Sep 21, 2020
Tried to install and configure an agent on an Ubuntu server located on the Azure cloud. Got the same error.
1.Make sure your Azure Devops account has the permission to manage the agents in current Org.
2.Then create a new PAT with Read & manage permission.
3.Run the config.cmd again, and enter a new Name at this step:
4.If the issue persists, you can create a new agent pool and register the agent there to check if it helps:

RH Develoiper Studio to JBoss EAP server connection

I have tried Developer Studio 11.3.0, and 12.0.0. I've tried EAP 6.4.0, and 7.1.0. Everything gives me the same error. I've run it with servers in RHEL on AWS and a DevStudio in Windows 10 or Windows 7. I've run it with server and DevStudio on the same Fedora system. Always the same error when I try to "start" the remote server:
The initialization produced an exception, which can occur due to incorrect security credentials. Please review the exception messages by clicking the Details button.
* java.io.IOException: java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://LOCALHOST:9990. The connection failed
* java.net.ConnectException: WFLYPRT0053: Could not connect to http-remoting://LOCALHOST:9990. The connection failed
* WFLYPRT0053: Could not connect to http-remoting://LOCALHOST:9990. The connection failed
* Authentication failed: all available authentication mechanisms failed:
JBOSS-LOCAL-USER: javax.security.sasl.SaslException: ELY05128: [JBOSS-LOCAL-USER] Failed to read challenge file [Caused by java.io.FileNotFoundException: /datavirt/jboss/EAP-7.1.0/standalone/tmp/auth/local3848441195962286340.challenge (Permission denied)]
DIGEST-MD5: javax.security.sasl.SaslException: DIGEST-MD5: Server rejected authentication
Here's a bit of the server.log file, where things go wrong. (It's slightly different in 6.4.0, but not substantially.)
2018-09-01 23:20:52,946 TRACE [org.jboss.remoting.endpoint] (management I/O-2) Allocated tick to 8 of endpoint "miramanee:MANAGEMENT" <68fb9f51> (opened org.jboss.remoting3.EndpointImpl$TrackingExecutor#18776914)
2018-09-01 23:20:52,946 TRACE [org.xnio.nio] (management I/O-2) Running task org.jboss.remoting3.remote.ServerConnectionOpenListener$2#228e4439
2018-09-01 23:20:52,946 TRACE [org.xnio.nio.selector] (management I/O-2) Beginning select on sun.nio.ch.EPollSelectorImpl#617c6bff (with timeout)
2018-09-01 23:20:52,946 TRACE [org.xnio.nio] (management I/O-2) Select, queue is empty
2018-09-01 23:20:52,946 TRACE [org.wildfly.security] (management task-7) Handling RealmCallback: selected = [ManagementRealm]
2018-09-01 23:20:52,946 TRACE [org.wildfly.security] (management task-7) Handling NameCallback: authenticationName = admin
2018-09-01 23:20:52,946 TRACE [org.wildfly.security] (management task-7) Principal assigning: [admin], pre-realm rewritten: [admin#ManagementRealm], realm name: [DIGEST], post-realm rewritten: [admin#ManagementRealm], realm rewritten: [admin#ManagementRealm]
2018-09-01 23:20:52,947 TRACE [org.wildfly.security] (management task-7) Handling CredentialCallback: obtained credential for correct realm "ManagementRealm"
2018-09-01 23:20:52,947 TRACE [org.wildfly.security] (management task-7) Handling CredentialCallback: obtained credential: org.wildfly.security.credential.PasswordCredential#b75f36fa
2018-09-01 23:20:52,947 TRACE [org.jboss.remoting.remote.server] (management task-7) Server sending authentication rejected: javax.security.sasl.SaslException: ELY05055: [DIGEST-MD5] Authentication rejected (invalid proof)
at org.wildfly.security.sasl.digest.DigestSaslServer.validateDigestResponse(DigestSaslServer.java:281)
at org.wildfly.security.sasl.digest.DigestSaslServer.evaluateMessage(DigestSaslServer.java:358)
at org.wildfly.security.sasl.util.AbstractSaslParticipant.evaluateMessage(AbstractSaslParticipant.java:180)
at org.wildfly.security.sasl.digest.DigestSaslServer.evaluateResponse(DigestSaslServer.java:331)
at org.wildfly.security.sasl.util.AuthenticationCompleteCallbackSaslServerFactory$1.evaluateResponse(AuthenticationCompleteCallbackSaslServerFactory.java:58)
at org.wildfly.security.sasl.util.AuthenticationTimeoutSaslServerFactory$DelegatingTimeoutSaslServer.evaluateResponse(AuthenticationTimeoutSaslServerFactory.java:106)
I am plumb stumped.
If you want to get it going quickly for learning/etc, then I can just say what I'm doing. I have RHEL 7 & EAP 7.1. I'm using dev studio 12 on same machine. When I added a server into dev studio, I had option to select local or remote. I selected local and had no problems starting via dev studio. The user I'm running dev studio with also has permissions to EAP home directory (I see file perm errors in your error). I also chose management options vs. Filesystem and shell operations. I also test, and this worked picking remote as well. But again, same server for everything/same localhost.

meteor-up deploy on Amazon EC not working, wait-for-mongo: failed to connect to [127.0.0.1:27017]

I have the following in my mup.json
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.36 by default. Do not use v, only version number.
"nodeVersion": "0.10.43",
// Install PhantomJS in the server
"setupPhantom": false,
// Show a progress bar during the upload of the bundle to the server.
// Might cause an error in some rare cases if set to true, for instance in Shippable CI
"enableUploadProgressBar": true,
// Application name (No spaces)
"appName": "myapp",
// Location of app (local directory)
"app": "/path/to/myapp",
// Configure environment
"env": {
"PORT": 5555,
"ROOT_URL": "http://myserver.com"
},
I got this in the deploy log
Started TaskList: Deploy app 'myapp' (linux)
[myserver.com] - Uploading bundle
[myserver.com] - Uploading bundle: SUCCESS
[myserver.com] - Setting up Environment Variables
[myserver.com] - Setting up Environment Variables: SUCCESS
[myserver.com] - Invoking deployment process
[myserver.com] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
eding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm#2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
js-bson: Failed to load c++ bson extension, using pure JS version
/usr/lib/node_modules/wait-for-mongo/bin/wait-for-mongo:14
throw err;
^
Error: TIMEOUTED_WAIT_FOR_MONGO
at null._onTimeout (/usr/lib/node_modules/wait-for-mongo/lib/waitForMongo.js:20:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:121:15)
-----------------------------------STDOUT-----------------------------------
.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
wait-for-mongo: failed to connect to [127.0.0.1:27017]
when I ssh to the ec2 server and it looks like mongod is not started?
/opt/myapp$ ps -aux | grep mongod
ubuntu 9566 0.7 2.1 661524 22144 ? Sl 22:32 0:00 node /usr/bin/wait-for-mongo mongodb://127.0.0.1/myapp 300000
ubuntu 9569 0.0 0.0 10464 916 pts/0 S+ 22:33 0:00 grep --color=auto mongod
/opt/myapp$ mongo myapp
MongoDB shell version: 2.6.12
connecting to: myapp
2016-04-05T22:44:07.802+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-04-05T22:44:07.803+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
I'm not sure how to gain access to mongo on the server, given that I "handed over" responsibility to meteor-up with "setup-mongo":true.
Any ideas would be appreciated.
update
switched to mupx, and set "deployCheckWaitTime": 300 mongo is now loading correctly. But now I am getting this error:
/bundle/bundle/programs/server/node_modules/fibers/future.js:278
throw(ex);
^
MongoError: driver is incompatible with this server version
at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
at [object Object].MongoConnection._ensureIndex (packages/mongo/mongo_driver.js:790:1)
at [object Object].Mongo.Collection._ensureIndex (packages/mongo/collection.js:635:1)
It seems to be related to these issues:
https://github.com/arunoda/meteor-up/issues/841
https://github.com/meteor/meteor/issues/5809
SOLVED
I must had incompatible versions on my system from using mup and also meteor create; meteor mongo earlier on the ec2 server. I linked /opt to an empty folder in a different partition (had space problems) and ran mupx setup/deploy again from scratch. This time it worked fine (with Meteor 1.3).
Strangely, I noticed there was no /opt/nodejs folder, which was probably a leftover from my first attempt with mup.
also, the docker daemon doesn't seem to be running, but I can connect to my mongoDB from an ssh session the mup way
$ mongo myapp // works fine
$ docker exec -it mongodb mongo myapp
Cannot connect to the Docker daemon. Is the docker daemon running on this host?