Problem creating REST API With JSON Server - json-server

I am going through the tutorial: https://www.youtube.com/watch?v=x3NAo8zqdmo
to set up json server. I am able to install it, however when I run the command json-server --watch db.json, I keep getting error
events.js:183
throw er: //unhandled 'error' event
I googled the error, there is nothing running on port 3000 . I even rebooted my machine but error did not go away.
I reinstalled json-server using my company's proxy settings to go behind proxy settings since I had to do that for angular cli installation, but still error is not going away. Any tips?

I was able to resolve the issue by changing the port with command
json-server -p 4000 db.json

Related

Busybox wget strange behaviour

I need some help with a really strange problem.
I use wget (busybox) to obtain the the IP address of some remote clients, to use it on a DNS (a sort of "homemade ddns"). Those clients run a script that every 5 mins calls
wget -O /dev/null "https://my_dns.org/poll.php?user=User_N&pwd=password_N"
Everything was fine, until I updated my http server to remove TLS1.0/TLS1.1
After updating: running the above command on the clients' console it still works OK, while running it automatically (launching it from a script in /etc/init.d) I get this error:
Connecting to my_dns.org (www.xxx.yyy.zzz:443)
wget: error getting response: Connection reset by peer
...Any idea about why does this happen, and how to fix...?
(The shell on the clients runs as root...)
Thank you in advance for your help
Regards

Eclipse Che Websocket Unable to Establish Connection

I'm running Che on WS2019 under Docker for Windows. When starting Che using the call from the guide (see copy below, custom port added) it pulls the container and sets it up all ok.
docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /chedata:/data -e CHE_PORT=8090 eclipse/che start
When I open Che and go to the workspace (localhost:8090) to create a project, the create button is greyed out, and the browser console has the below errors.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://wsagent-http-dev-machine-workspacel90axz6gl3kl3mzl.192.168.1.100.nip.io:8090/api/project-type. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
Firefox can’t establish a connection to the server at ws://localhost:32845/wsagent?token=. playground:18015:24
ERROR (org.eclipse.che.ide.projecttype.ProjectTypeRegistryImpl): Can't load project types: org.eclipse.che.ide.commons.exception.ServerDisconnectedException _app-0.js:17942:126
WARNING (org.eclipse.che.ide.websocket.impl.BasicWebSocketEndpoint): Error occurred for endpoint ws://localhost:32845/wsagent?token= _app-0.js:17942:126
Firefox can’t establish a connection to the server at ws://localhost:32845/wsagent?token=. playground:18015:24
WARNING (org.eclipse.che.ide.websocket.impl.BasicWebSocketEndpoint): Error occurred for endpoint ws://localhost:32845/wsagent?token=
To keep firewalls out of the issue, I've disabled windows firewall. Initially I have tried to fix the CORS issue by using CHE_CORS_ENABLED with no such luck.
I've tried specifying CHE_HOST and CHE_DOCKER_IP_EXTERNAL flags with effectively the same result. I have also tried using CHE_SINGLE_PORT=true, with again a similar issue.
I've looked at a lot of the other GitHub issues reported on Che (e.g. https://github.com/eclipse/che-dockerfiles/pull/11) and have been going at this for a good few days to no avail.
Any suggestions would be helpful,
Inci

Why "webdriver-manager start" works on and off?

I run the webdriver-manager start but now it is not working all the time. I try to run it with the --proxy option and sometimes it works and sometimes not.I also get the following error.
Error:getaddrinfo ENOTFOUND chromedriver.storage.googleapis.com: 443
But after 5 minutes I ran it and it worked well!
Any insight would be appreciated
I am not sure but probably issue was corresponding to port. When command was running first time from console you have wiped console but process was still alive. So you caught this error when was trying to run this command again from another console but previous process was still alive and was a root of error. Just try firstly end process and only then close a console.

Having issue with Tomcat when I run in a eclipse

I am novice in java I have installed Tomcat and it runs fine in a browser but when I run in a eclipse its showing error like
Several ports (8005, 8282, 8009) required by Tomcat v7.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
I would like to mention one thing I am not authorized to login with admin account I have tried lot to stop the already running stuff through command prompt and i followed this link Deployment error: Starting of tomcat fail
however I am getting the same error is there any way to solve this issue.
Thank You.
Some other process is using one or more of the ports needed by tomcat (8005, 8282, 8009). Probably an old instance of tomcat. Kill it, then try again.
You can run netstat -abn on windows or netstat -apn on Linux to figure out which process is listening to these ports.

missing mysqld.sock and mysqld in /etc/init.d

I tried today to connect to MySQL server and saw that I did'nt have any mysqld.sock anymore, nowhere.
I tried several ways to get it back, but unsuccessfull. I tried to execut a
./mysqld.start in /etc/init.d, but it's also missing.
Should I reinstall mysql, or is there a way to get a socket back ?
try using following command
service mysql start
This will work.
#Nueva, if that doesn't work, reboot the system. I just had an Ubuntu build on EC2 lose its mysqld.sock file, and a simple reboot solved the problem.
Failing that, I've also heard that forcing the connection via tcp instead of localhost has worked for some people. I tried that, but got nothing.