Why does the terminal throws Gin-debug Error in Go lang application? - visual-studio

I was trying to run my go application but have come across this error , thrown to me as [GIN-debug] [ERROR] listen tcp 127.0.0.1:8080: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
I have tried running these commands "net stop hns && net start hns" in windows shell as #admin but still cannot overcome this error.
How to resolve this?

Related

How to fix VS Code error with Remote-SSH: "the terminal process failed to launch: A native exception occurred during launch (forkpty(3) failed.)."?

I've installed and used the Remote-SSH extension in VS Code to access a Linux staging environment and work remotely.
The setup and connection works for one user, however is not allowing me to connect as a different user (on the same server).
Immediately after connecting, an error pops up saying the terminal process failed to launch: A native exception occurred during launch (forkpty(3) failed.). and the terminal would fail to open. If I attempt to manually open the terminal, it will fail with the same error.
Here is an example of how my Remote-SSH config file looks:
Host configfile1
HostName host.website.com
User username1
IdentifyFile "[key file path]"
Host configfile2
HostName host.website.com
User username2
IdentifyFile "[key file path]"
I could connect just fine and open remote terminal with configfile1, however would run into the aforementioned error when attempting to connect with configfile2.
I have tried various solutions mentioned in this GitHub issues thread, but to no avail: https://github.com/microsoft/vscode-remote-release/issues/4233
Does anybody have a solution for this?
I don't know the underlying causes for this, but this error pops up when using jailed shell settings.
Try changing the user's SSH shell settings to normal shell, and you may be able to connect without an issue.
This may not be ideal for all scenarios or security considerations, however, but it will allow Remote-SSH to connect and spawn the terminal.

Composer-Rest-Server not connecting

I am testing a a business network I created, I ran the Composer-rest-server and all worked fine, then shut the server as suggested in the developers guide , then I proceeded use the yo hyperledger composer to create the skeleton of the angular app, however, now the angular app is showing in the local browser, however, the composer-rest- server is not.
Expected Behavior:
I should start the composer-rest- server in localhost:3000 and the angular app as well
Actual Behavior:
I get this message;
scovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
Error: Error trying to ping. Error: Error trying to query chaincode. Error: Connect Failed
at _checkRuntimeVersions.then.catch (/home/node/.nvm/versions/node/v6.11.2/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:696:34)
Your Environment
composer-cli#0.11.3
generator-hyperledger-composer#0.11.3
composer-rest-server#0.11.3
Docker version 17.06.0-ce, build 02c1d87
docker-compose version 1.13.0, build 1719ceb
The Problem
If you kill your fabric instance using ./stopFabric that you started using the ./startFabric command then all the containers that were apart of the business network were killed as well and therefore you need to reinstall the .bna and start the network again. (the development flow provided is purposely volatile for rapid development)
The Solution
1.) Type docker ps to see all of your running containers. You should see none if you are getting that error because your peer is not responding to pings
2.) Open a separate terminal and navigate to where you have fabric-dev-servers in the terminal and run ./fabricStart. This will start all the containers like your network Certificate Authority, the peer, the orderer, etc.
3.) Return to your project in another terminal. Do Step 1 & 2 found at the developer tutorial (you likely won't need to do step 3 since you likely already imported the network administrator identity going through the tutorial)
4.) Run composer network ping --card admin#tutorial-network. The ping should go through.
5.) Run docker ps. You should see 4 containers running
6.) Run composer-rest-server and follow the steps from the tutorial.
7.) Run cd tutorial-network-app to switch to where your angular application is (or wherever you generated it with the yo command)
8.) Navigate to http://localhost:3000 and everything should work.
Any other questions or problems just reply here and I can help.
The expected behaviour is that the REST server is already running (the the generator uses Loopback to spin up a REST server already (that's why you shut down the previous REST server)). Its described here https://hyperledger.github.io/composer/unstable/tutorials/developer-guide.html under 'Generate your Skeleton Web Application'.
After you created the application - following completion of the yo hyperledger-composer questions (and after providing the answers) you run your application using npm start from within the generated application directory. Your app is accessible at http://localhost:4200.

unhandled error when trying to run rethinkdb-poll-demo on windows

I've tried to follow the instructions on RethinkDB for Windows: developer preview youtube video, which uses the code from Github https://github.com/segphault/rethinkdb-poll-demo. RethinkDB runs as expected on localhost:8080, but when I tried to run app.js from the rethink-poll-demo directory by entering 'node app' in the command prompt, I get an error message after "Creating a pool connected to local host:28015
events.js:141 throw er; // Unhandled 'error' event
Error: listen EACCES 0.0.0.0:8000"
I haven't changed any code, am new to both node.js and rethinkDB. Does anyone have any idea what's going wrong?
You have another process binding to port 8000.
Check it by running: netstat -an

Mongodb on Terminal keeps getting stuck

I have a Macbook Pro with El Capitan. I installed mongodb on my terminal with macports, which is similar to homebrew. I've followed all of the instructions and I've made sure to change the user permissions to /data/db. Does anyone have any idea of what's wrong with my mongodb installation?
Whenever I try to run "mongod", it keeps pausing at "waiting for connections on port 27017". This is shown in Screenshot 1. Then I hit CTRL-C to exit, and I get more error messages shown in Screenshot 2. Also the "mongo" command does not work either.
Here is the error report shown when entering "mongo".
MongoDB shell version: 3.0.8
connecting to: test
2016-01-11T19:08:41.888-0600 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2016-01-11T19:08:41.890-0600 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
Here is a link to my google drive with a photos of the error report for "mongod".
Screenshot 1 - https://drive.google.com/file/d/0Bwl_BDx-HIfcYnBJRUJfbzFvSm8/view?usp=sharing
Screenshot 2 - https://drive.google.com/file/d/0Bwl_BDx-HIfcdkVkUWJzeENuelU/view?usp=sharing
Whenever I try to run "mongod", it keeps pausing at "waiting for connections on port 27017".
This is exactly what it is supposed to do. Unless you indicate otherwise via a command switch (such as "--fork"), running "mongod" starts up the mongo server process within the current shell and blocks that shell until the process is terminated (via CTRL+C).
If you want to connect to the running mongo server process via the mongo shell, you'll need to open a second terminal to do so. From there, run "mongo" and it should connect to the server running in the first terminal shell.
Re-cap:
In terminal #1, run "mongod". When it says "waiting for connections...", it's ready to accept client connections. Do not stop the process via CTRL+C; do not close that terminal.
In terminal #2, run "mongo". It should connect to the server successfully.
This "connection refused" message is significant:
2016-01-11T19:08:41.888-0600 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
You need to work with the packet filter to flush all the rules. See this article near the bottom in order to open port 27017 which is what mongod uses:
http://www.macworld.co.uk/how-to/mac-software/how-open-specific-ports-in-os-x-1010-firewall-3616405/
This is quite direct:
https://gauravsohoni.wordpress.com/2015/04/14/mac-osx-open-port/
This may be less helpful but still worth glancing through:
https://support.apple.com/en-us/HT201642

Impossible to run web application in debug mode with intelliJ on ubuntu with glassfish server

In intelliJ 12.0 on ubuntu 12.04 with glassfish 3.1.2.2, I'm trying to launch my web application in debug mode but I've got this error message:
Error starting domain domain1.
The server exited prematurely with exit code 134.
Before it died, it produced the following output:
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:741]
I try to change the port 9009 in the domain.xml by another one but it was unsuccessful.
Could you help me to fix this problem?
Thank you
I had this same problem too a few weeks ago. I dont remember 100% what I changed but I know it has to do with the file $GLASSFISH_HOME/glassfish/domains/domain1/config/domain.xml. If I recall I think I changed the following line:
<java-config debug-options="-Xdebug -Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=9009" system-classpath="" classpath-suffix="">
In particular server and suspend flags. When I set them like this the error you described above went away.
I had the same problem, and was because the debug port 9009 had beeen occupied by the DbVisualizer application. DbVisualizer uses some random ports, and at this time, it chosed the 9009. In my case, I only had to close DbVisualizer and GlassFish started up in debug mode fine.
So, check out no processes have occupied your Glassfish debug port.
Another possible solution is to change this port, or use shared memory.
Regards
In recent versions of IntelliJ the application is aware of invalid settings for debug mode. If this is the case, when you open the Run/Debug configuration of your Java EE server, in the bottom you will see a warning message:
Just press the fix button and you will fix your 'domain.xml' configuration file.
This is also explained in this tutorial: https://www.jetbrains.com/help/idea/2016.1/developing-a-java-ee-application.html
For the future poor soul that has the same issue as me:
One of the tools that comes with Gigabyte mainboards (gCloud I believe) registers a Windows service on port 9009. This port then shows up in netstat -ano as being in use by PID 4 (Windows system something).

Resources