Docker and Chromium net::ERR_NETWORK_CHANGED - angularjs

I have an AngularJS application that does an ajax call but it results in a chromium error:
net::ERR_NETWORK_CHANGED
I tried to disable any adapters that I don't need. I have multiple ones and multiple dockers containers running.
I disabled ipv6 on each adapter. I don't use any proxy and use default Chromium browser without any addon nor browser profile.
Disabled Wifi interface, only using ethernet.
Any idea how to fix this?

I was constantly getting ERR_NETWORK_CHANGED.
This is what finally worked for my current browsers:
Chromium, Opera and FlashPeak Slimjet.
sudo service docker stop
The following actions did not solve my issue:
Checked modem, router, and cables to isolate the issue.
Disabled IPv6 from my wired Network
Commands:
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
After I stopped Docker, I am not getting any more console errors.
I hope this can help someone saving hours of annoying troubleshooting.
Ron.

sudo service docker stop
But this is not a solution because I need docker in my daily work.
So I found out that docker networks cause this problem
docker network prune helped me
Or try to delete one by one except of none, bridge, host

Based on the original answers, I want to go into more detail what fixed it in my case.
Stopping the docker service sudo service docker stop in my case fixed the issue.
The underlying issue one of my docker-compose setups having restart=always.
Unfortunatly I had a bug causing a container to terminate and restart. This restart caused the network change.
It is determinable by running docker ps and noticing the container restarted.
I fixed the problem and ran docker-compose down for my docker compose setup. Both actions would fix it independently.
Furthermore a Bugreport for chromium exists regarding this issue, but it has the state wontfix.

Related

Expo, java.net.SocketTimeoutException:failed to connect

am new to React native Expo I need to add some new modules on my project. "expo": "33.0.0", "react": "16.8.3", whenever I try to run my project am getting Error am not able to run the project. I tried all way to run the project like set REACT_NATIVE_PACKAGER_HOSTNAME='192.168.0.102', firewall off, allowed inbound 19000 port etc. but am getting error.
when I enter expo start -c
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Starting Metro Bundler on port 19001.
Your JavaScript transform cache is empty, rebuilding (this may take a minute).
Your native app is running at exp9c305c55e38f4d0e856f59397620314e://192.168.0.101:19000
Logs for your project will appear below. Press Ctrl+C to exit.
then my laptop and mobile is connected with same network and same IP but am getting error and i don't know the port 19000 is different from my wifi
Uncaught Error:java.net.SocketTimeoutException:failed to connect to/192.168.1.20(port 19000)from/192.168.0.102(port 49615) after 10000ms
Please give some solution for it.
It's failing because port 19000 is not open in your firewall. If you use linux OS open this port by running:
sudo ufw allow 19000/tcp
enter image description hereFirst Check are you in tunnel connection?
If you are in tunnel connection then
First : ipconfig
then : set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.103 (IPv4 Address)
then:npm start
It worked for me. Hopefully it will help.
I resolved this by changing the network profile on the connected wifi from private to public.
Expo Error Fix

ReactJS: How to kill `serve -s build`

Serve is a library that allows you to serve your React build folder similar to npm start
Create an app with npx create-react-app .
Then run the following the following to create build and serve the app
npm run build
npm install -g serve
serve -s build
It works perfectly, only how does one kill the listening on port 5000
control c brings back the suspended terminal prompt and lsof -iTCP -sTCP:LISTEN -n -P indicates that it is no longer listening on port 5000.
pkill -9 node does not do it.
Even though it appears not to be listening on port 5000 I can go to localhost:5000 and it serves up the file as though it were listening on 5000;
NOTE: this happened on MacOS
The reason you're still seeing content even after the server is killed is because you're using a Service Worker. Service Workers will cache content so that even when a user is offline, they can continue to use your web app. What you're experiencing is the intended functionality.
You can make your life a little easier by using Incognito Mode when working with service workers, so you can easily reset your browser and thereby clear any active service workers.
I'd recommend you read more of the Workbox documentation as I can see you're working with that framework.
Another way to stop a service worker is through the Chrome Dev tools panel.

Deploying Haskell yesod docker container on google app engine

I am trying to upload a yesod Docker container on Google App Engine. The source code is here and the Docker image is here.
I followed the documentation in the Custom runtime quickstart, and when invoking gcloud app deploy the app builds fine after increasing the build timeout, but the container either the readiness check when trying to start or shows the following timeout message:
ERROR: (gcloud.app.deploy) Operation [apps/meeshkan-github-webhook-router/operations/xxxx-xxxx-xxxx] timed out. This operation may still be underway.
I have tried experimenting with several things, including a manual readiness check, creating an /_ah/health endpoint, and increasing the timeout of the readiness check all the way to 1799 seconds, but none of these actions seem to work.
One issue may be the size of the container (it is 3.2gb), and I could try to prune it down, but I'd only do that if someone could confirm that container size is a contributing factor to deployment problems. Other than that, I'm not sure what could be causing this failure. The docker image starts fine on our local machines.
Thanks in advance for your help and suggestions!
The issue turned out to be that, because I was building on Windows, images built using Docker Desktop on Windows gave all shell scripts executable permission automatically, whereas Docker on Linux needs shell scripts to be given the executable permission. By adding this line to my Dockerfile:
RUN chmod +x /usr/src/app/run.sh
Everything worked fine!

Jenkins Artifactory plug-in: Error occurred while requesting version information: Connection refused

I get the error "Error occurred while requesting version information: Connection refused" when I test the connection in Jenkins configuration for Artifactory plug-in. I have tried it with Anonymous access enabled in Artifactory, with Anonymous access disabled, and tried all three options (Supported, Unsupported, Required) for Password Encryption in Artifactory. I have Default Deployer Credentials in my Jenkins Artifactory configuration, and I have tested the connection with 'Use Different Resolver Credentials' and without. I consistently get this error.
Any help/ideas would be greatly appreciated
I also ran in a similar problem yesterday.
Problem:
I was running jenkins and artifactory in two different docker containers on my local. I had exposed port 8086 for artifactory and could access it using http://localhost:8086/artifactory in my browser. But giving the same url for artifactory in jenkins produced the above reported error in question.
Solution:
For some unknown reasons, jenkins artifactory plugin couldn't resolve http://localhost:8086/artifactory even though the docker mappings was correct and it was possible to connect to artifactory web based console with the same URL.
Replacing "localhost" with docker container IP did the trick.
Name of my container in which artifactory was running was docker-plgr_artifactory_1
Admins-MacBook-Pro-2:~ prakash.tiwari$ docker exec -it docker-plgr_artifactory_1 cat /etc/hosts
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.18.0.2 08038bc9449b
The IP of container was 172.18.0.2. So I replaced http://localhost:8086/artifactory with http://172.18.0.2:8081/artifactory and jenkins was now able to connect to artifactory. (8081 is the port in docker container at which artifactory was running. You'd have given it at the time of running the container. Alternatively, you can find it by running docker ps and checking the value under PORTS field.)
Credit: https://www.arvinep.com/2016/04/jenkins-docker-container-problem.html
Note: I know this solution doesn't explain the cause and why it works, but I hope it at least helps some people and saves their time.
I see that you asked this question a while ago. I just had to deal with a very similar situation. I had loaded the root and intermediate certificates into the cacerts files found under the 4 version of Java on the build server. The problem was that Jenkins uses it's own cacerts file found in the Jenkins install folder. Once I loaded the certs there I was able to test the connection to artifactory and upload the build artifacts. I hope this helps

End To End Testing on Headless Server

I am trying to set up an environment for end-to-end testing on a droplet running Ubuntu server 12.04.3 on digital ocean.
What I am trying to achieve in the end is for my jenkins (installed on the one droplet) to be able to run my end-to-end tests. Now, the server is ofcourse headless and the end-to-end tests need to run through a browser (I am using protractor with the selenium standalone server with chromedriver).
My question is: how do I spawn a browser on that machine? I have installed xorg and if I do startx on the server, log out and ssh -X to it, I can manually run the end-to-end tests (a browser pops up on my local machine). But I can get it to work without ssh -X to it, and since jenkins is on the same droplet where the tests are to be run. Well I dont get a browser to spawn.
NOTE: I know I might be missing something really trivial here since I don't fully understand the configuration nor the xorg.
Any hints or a complete answer is very much appreciated, this is giving me gray hair.
Edit: After a little digging I think i got the xorg stuff a bit wrong, i am guessing the purpose of X is to be able to spawn a window on a remote machine ( ie my local machine). And what i am after is more along the lines of a virtual frame buffer such as Xvfb...
There is PhantomJS but with Protractor is buggy and a dead-end.
You can still use Chrome & Firefox headless through docker-selenium or, if you don't like Docker you can do it yourself with ubuntu-headless sample. Both solutions provide Chrome & Firefox by using Xvfb even though there is no real DISPLAY.
UPDATE 2 Seems to be possible to run Xvfb in OSX: http://xquartz.macosforge.org/landing/
UPDATE 1 Mac OSX selenium headless solution:
Enable multi-user remote desktop access to OSX machine
So can test selenium headless on mac. Not headless really but as another user so it doesn't interfere with your current user display.
To do this you need kickstart: http://support.apple.com/en-us/HT201710
Begin using the kickstart utility
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent
Activate Remote Desktop Sharing, enable access privileges for all users and restart ARD Agent:
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all
Apple Remote Desktop 3.2 or later only
Allow access for all users and give all users full access
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
Kickstart help command
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help
A lot of angular apps use Travis CI to perform Protractor based end-to-end integration tests on headless vms all the time. I do not know the details of exactly how they do it but I do know that they use a linux service called xvfb which is a headless x windows implementation. Looking at a typical Travis configuration file, it appears that all they do before firing up their web server, selenium server and kicking off Protractor is to call sh -e /etc/init.d/xvfb start to start this service.

Resources