The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host xxx: Connection refused - connect(2)> - ruby

I've searched the forums to find similar bugs but have not found a solution. I literally just deployed to my staging site 30 minutes ago. And now it is giving me an error. I've been using the same method for months now, so I have no idea what's changed.
Just running this Capistrano script:
scripts/deploy staging
And I get this error:
The deploy has failed with an error:
#<SSHKit::Runner::ExecuteError: Exception while executing on host xxxx: Connection refused - connect(2)>
Clearly an ssh issue. But why would it be working one second, then not the next?
I also don't want to mess anything up on my production server.

Oh boy, this is so silly. I went back to my office and it worked. It must've been blocked by the location I was at! I was trying everything. Connecting to ssh, etc wasn't working. And now it's fine.

Related

Info There appears to be trouble with your network connection. Retrying

I am facing this issue since couple of days.
I was trying to host strapi on azure with azure postgres DB.
while deploying to web app from visual studio code it throws
“info There appears to be trouble with your network connection. Retrying…”.
It tries to Fetch Packages and throws that info couple of times and throws following error:
error An unexpected error occurred: “https://registry.yarnpkg.com/date-fns/-/date-fns-2.24.0.tgz: ESOCKETTIMEDOUT”.
I works fine locally.
I have tried every solution on the internet but nothing seems to work
Project folder structure:
I have tried everything from
Yarn - There appears to be trouble with your network connection. Retrying
I had this issue before, I was using the wrong npm registry.
So, basically, paste it on your terminal:
npm config set registry https://registry.npmjs.org/
If you have a .npmrc file make sure to point it to npm, like this:
registry=https://npm.pkg.github.com

postgres bad connection localhost

On UBUNTU, I have a ruby app with a postgresql database on my localhost.
Everything was working fine yesterday, but today my database was gone. I was still able to open the app. Then I got an error saying something like,
run rails db:migrate
After I ran the command I started getting
PG::ConnectionBad at /
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
None of the config files were changed since yesterday.
I use docker-compose up to start the server and apparently it starts the connection but I still cannot access my localhost.
What could be the problem here?
Thank you in advance
Check the logs in your DB, if the DB is running on docker as well then maybe it's not finishing the DB boot correctly.
If this is the case, run the DB container manually first with the same options as in your docker-compose and then check docker logs for that container.

Running dusk tests on Homestead for Windows

I'm using homestead on windows 10 and installed laravel 5.4 when I'm trying to run dusk tests I get the following error:
1) Tests\Feature\ViewProductListingTest::user_can_view_product_listing
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}
Failed to connect to localhost port 9515: Connection refused
Has anybody had any luck getting around this?
Thanx.
I encountered this very problem today. I spent like 2 hours researching and finally resolved it by following the steps posted on this comment.
I ran the original basic test and it passed. I'll try to run more complex test and hopefully the solution still works.
It seems to me that the Homestead lacks some necessary software(Chrome, xvfb etc.) to run browser tests with Laravel Dusk. That's what that comment is trying to install.
Hope this helps!
I ran into this issue before and was not able to completely resolve it.
The connection refused error occured for me because the execution scripts for dusk in /vendor/laravel/dusk/bin were not set executable inside Homestead.
So i used a chmod 777 on those scripts.
After that it complained that if couldn't find an executable chrome binary, so i installed google-chrome in Homestead.
After I installed google chrome, the tests ran, but timed out before they could finish which i am researching now.
I ran into the same issue (but I'm on macOS Sierra). If you can, instead of running Dusk from the Homestead VM, run it from your host machine. Just make sure the DB_HOST value in your .env file is set to the hostname you use to access the site in your browser.
So for example, if you configured the Homestead site to be accessible at mycoolsite.app, use that as your DB_HOST value.
I know this is more of a workaround for situations where your host machine might be able to run it OK, but it's working for me at the moment if you can give it a try.

"Failed to connect to repository" in Jenkins on OSX to GitHub

Getting this error when setting up my GitHub repo in Jenkins on a OS X machine.
Failed to connect to repository : Command "git ls-remote -h https://github.com/username/repo.git HEAD" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://github.com/username/repo.git/': Internal SSL engine error encountered during the SSL handshake
This has been working before and I've been running build successfully connected to this repo but all of a sudden I started to get this message. Does anybody have any idea?
Thanks
PS. Have looked at the other related questions but they don't have the exact same issue and/or are not on the same platform as me.
I think I found what the issue was. I logged into the mac machine with a certain user and started the jenkins.war file from there. It worked fine until I logged out the user, that's when I started to see the problem and why I resolved it by restarting the computer. So as long as I am not logging out the jenkins user, everything is fine.

Jenkins Deploy Error Tomcat 6.x

Im trying to use jenkins to build and deploy the war file to a tomcat present in different server and im getting the following error -
Deploying /var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war to container Tomcat 6.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:195)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:905)
at hudson.FilePath.act(FilePath.java:878)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:969)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: java.io.FileNotFoundException: http://192.168.2.X/manager/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:504)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:622)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:635)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:176)
... 16 more </code>
Can anyone tell me what is wrong?
I had exactly this problem just now and still have not solved it. However, I suspect it is happening because of proxy issues.
Is it possible to try setting the manager URL to http://localhost
rather than http://192.168.2.X? This worked for me, showing that the credentials were at least correct and the module functions. When I switch the manager URL back to a remote machine or the FQDN of the local server, it again failed. This indicates to me something proxy related.
The only trouble then is configuring the proxy settings for Jenkins, especially http.nonProxyHosts. If you can do that maybe you'll have more luck than me. I cannot get the Jenkins System Information proxy values to change no matter what I do!
Also manually test from a browser on both the build server and elsewhere your access to the manager URL: http://192.168.2.X/manager/list

Resources