How to start the Web UI of Chirpstack-Application? - docker

OS: Windows 10 Pro
The whole setup for properly starting up the Web UI seems confusing to me.
There’s the source code to the chirpstack-application-server and its finished docker image. Running docker-compose up at the source code directory starts all the necessary backend services, but not the UI. In the source code, there’s a section with the UI inside the /ui directory. Starting this through npm works up until after this console log:
Note that the development build is not optimized. To create a
production build, use npm run build.
After this I get this proxy error:
Proxy error: Could not proxy request /swagger/internal.swagger.json
from localhost:3000 to http ://localhost:8080/. See https:// nodejs.
org/api/errors.html#errors_common_system_errors for more information
(ECONNREFUSED).
Then there’s the chirpstack-appliaction from precompiled binary. I started this one by first creating the config file chirpstack-application-server configfile > chirpstack-application-server.toml and then starting the executable ./chirpstack-application-server.exe. Here I just get a connection error to PostgreSQL:
time=“2020-09-17T11:09:08+02:00” level=warning msg=“storage: ping
PostgreSQL database error, will retry in 2s” error=“dial tcp
[::1]:5432: connectex: No connection could be made because the target
machine actively refused it.”
So what am I missing to get the UI up and running locally?

Related

Cypress fails to visit localhost

I am new to Cypress, I am trying to run a simple test on a docker container but I get this error:
cy.visit() failed trying to load:
http://bp.localhost:84/
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: getaddrinfo ENOTFOUND bp.localhost
Common situations why this would fail:
- you don't have internet access
- you forgot to run / boot your web server
- your web server isn't accessible
- you have weird network configuration settings on your computer
But my container is running and I can access to the test website from my browser
I have been looking around for a solution, but most of the ones I've found are related to Cypress being inside the same docker image.
I have installed it locally with npm install since I cannot modify the image itself.
How do I access the above URL then?

How to get SonarQube (running in docker container) to connect to localhost:9000 from Jenkins Pipeline?

I am running SonarQube on both java and javascript code inside a CentOS VM. I pulled the sonarqube docker image and am running the container. I exposed port 9000 and am able to open up localhost:9000 and interact with the sonarqube gui. When I run the sonar-scanner from the command line on the JavaScript code using this command:
sonar-scanner -Dsonar.projectKey=javascript_code -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.login=admin -Dsonar.password=admin
I get a fully analyzed project. As well as the JavaScript code I can run it on the Java code using the maven build. Both work correctly from the command line.
When I add it into a Jenkins Pipeline I do the exact same commands and get the following:
Error: SonarQube server [http://localhost:9000] can not be reached
Caused by: Fail to get bootstrap index from server
Caused by: Failed to connect to localhost:9000
Caused by: Connection refused (Connection refused)
I also tried when starting the container to use --network="host" instead of publishing port 9000, but it still does not connect from the Jenkins Pipeline. Everything works correctly when I am running the commands from the Command Line, just when I try to put it into a Jenkins Pipeline.
Any suggestions on how to fix this? Thanks.
*Edit: Using the sonarqube plugin I was able to get my analysis to run as a Jenkins Job. However, when I try to add the analysis into the pipeline I get the same SonarQube server cannot be reached error. It says it skips my project because the project has been banned form the build due to previous failures and gives me this error message:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar (default-cli) on project sonarqubeproj:
Unable to execute SonarQube: Fail to get bootstrap index from server: unexpected end of stream on Connection{localhost:9000, proxy=DIRECT hostAddress=localhost/127.0.0.1:9000 cipherSuite=none protocol=http/1.1}: \n not found: limit=0 content=… -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar (default-cli) on project feedback-tool-ui: Unable to execute SonarQube
The problem you are facing is most likely related to how you run jenkins.
I assume you also run jenkins via docker. this means that in the context of jenkins, localhost is not your host system, but the jenkins container. This means you need to adapt your sonarqube-url to reference the host system.
Therefore you have multiple options:
use the public ip of the host system
use the docker ip of the host system
resolve the ip via dns. docker has an internal DNS and if those container run in the same network, you can normally reach them by containername.
sidenote:
i am not sure if you are using docker-compose or kubernetes, but if you are not using it, you might also want to dive into docker-compose as it is just a simple yaml-config in which you can easily start up servers.

Boot-clj connection refused

When attempting to run Boot inside Docker, using the adzerk/boot-clj image, I receive connection refused errors.
Specifically, when the container starts up, boot is started, and then a stack trace is output. The trace (which is not easy to copy and paste between computers with no connectivity) essentially is to do with downloading - https://github.com/boot-clj/boot/releases/download/2.7.2/boot.jar - and receiving "Connection refused" errors.
I’m asking, and answering this, question in the hope that it might help someone else.
Where to start?
My main problem was with a Docker + Clojure + Boot setup, specifically when running “boot” from inside the container. Doing this spewed out a stack trace. This is where my journey begins.
I’m using the adzerk/boot-clj image. I’ve used it locally (OSX) without issue, the problem I experienced was in using a VM (CentOS 7) hosted within a corporate data center.
docker run -ti adzerk/boot-clj
Issuing this starts up the container, the entry point is Boot, and it starts pulling down some jars, specifically boot.jar from Github. The resulting stack trace details several problems, but the crux of it was
“java.net.ConnectException: Connection refused” (connecting to Clojars.org:443)
Hmmm…
So instead of running Boot straight away in the container, I specified the container entry point as “—-entrypoint bash” so I can prod around a little.
So, wget - connection refused.
What about without Docker in the way. Same thing. Connection refused.
After a little wrangling with the network team, I found that the “https_proxy” env variable needs to be set on CentOS to route traffic out to the internet. A very specific issue to me in the situation.
However….
wget is now fine, both on the host, and inside the adzerk/boot-clj container. Boot however was not.
In an effort to simplify things even more, I took Docker out of the equation entirely, and used boot locally.
Installed java-1.8.0-openjdk.x86_64, installed Boot. Same problem.
So dug around a little, and found this - https ://github.com/boot-clj/boot-bin/issues/2
This was a start. It mentions setting the BOOT_JVM_OPTIONS, specifically https.proxyHost and https.proxyPort.
It still didn’t work… Arrrg.
OK, let’s take Boot out of the equation.
I wrote a test harness in Java, very simple that connects to https ://clojars.org and attempts to read the index page. Copied from https ://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html, and setting the JVM_OPTS.
It still fails. “Connection refused”
…. Weird beard.
I finally stumbled on this SO - https ://stackoverflow.com/questions/43695299/java-httpurlconnection-works-on-windows-and-fails-on-linux - specifically the answer from Stephen C
“Java doesn't necessarily respect your system's default proxy settings. Since you are able to "curl" the URL on the Linux machine, the most likely explanation is that Java is not using the proxy that you have configured. The following links explains various ways to configure the proxies for Java:”
So taking the first link - https ://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm - and the answer from Leonel
I issued “java -Dhttps.proxyHost=xxx -Dhttps.proxyPort=80 HelloWorld”
I get an error, but a different one. This is progress. “Unable to tunnel through proxy”
A quick Google of this led me here: http ://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html - “Disable Basic authentication for HTTPS tunneling”
So updated to “java -Dhttps.proxyHost=xxx -Dhttps.proxyPort=80 -Djdk.http.auth.tunneling.disabledSchemes=“” HelloWorld
Profit.
Info:
java -v
openjdk version 1.8.0_144
Openjdk Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
Sorry for all my profanity Boot.

Docker cannot acces registry from openshift

Here is my whole scenario.
I have a RHEL 7.1 vmware image, with the corporate proxy properly configured, accessing stuff over http or https works properly.
Installed docker-engine, and added the HTTP_PROXY setting to /etc/systemd/system/docker.service.d/http-proxy.conf. I can verify the proxy setting is picked up by executing:
sudo systemctl show docker --property Environment
which will print:
Environment=HTTP_PROXY=http://proxy.mycompany.com:myport/ with real values of course.
Pulling and running docker images works correctly this way.
The goal is to work with the binary distribution of openshift-origin. I downloaded the binaries, and started setting up things as per the walkthrough page on github:
https://github.com/openshift/origin/blob/master/examples/sample-app/README.md
Starting openshift seems to work as I can:
* login via the openshift cli
* create a new project
* even access the web console
But when I try to create an app in the project (also via the cli):
oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git
It fails:
error: can't look up Docker image "centos/ruby-22-centos7": Internal error occurred: Get https://registry-1.docker.io/v2/: dial tcp 52.71.246.213:443: connection refused
I can access (without authentication though) this endpoint via the browser on the VM or via WGET.
Hence I believe DOCKER fails to pick up the proxy settings. After some searching I also fear if there are IPTABLES settings missing. Referring to:
https://docs.docker.com/v1.7/articles/networking/
But I don't know if I should fiddle with the IPTABLES settings, should not Docker figure that out itself?
Check your HTTPS_PROXY environment property.

cannot connect: com.github.dockerjava.api.NotFoundException

I am trying to use the new feature of PHPStorm, which is to develop PHP app using docker.
I have installed the docker integration plugin for PHPStorm, when I try to define the Clouds settings, I get this error:
cannot connect: com.github.dockerjava.api.NotFoundException
I have checked the app, and its running in the browser normally at:
http://192.168.99.100:8090/
I didn't specify the certificates folder, as I am using http not https locally.
Any idea? I am on windows 10, I have installed jdk-7u79-windows-x64, I tried both 32, 64 versions, I got the same error..
Although the machine is up and running..
Try that:
The fastest way to connect is via ssh to the interpreter(Like vagrant):
Follow: https://hub.docker.com/r/jorge07/php7-xdebug-ssh/
Once machine is up:
Add remote interpreter:
Languages & frameworks > PHP
(Note that php executable in on: /usr/local/bin/php)
Now add a sftp service:
Build, Execution, Deployment > Deployment
Connect to machine by ssh and map your code folder with the /app folder on interpreter container.
Once you finish, you are done. Good luck!

Resources