Hyperledger: Error trying to ping. Unexpected end of JSON input - json

I'm trying to deploy my own .bna file to a business network using
this tutorial.
The only difference is that I am doing this with three organizations.
Everything works fine until I run the step eight because when I run this command:
composer network ping -c alice#trade-network
I got this error:
Error trying to ping. Unexpected end of JSON input.
Does anybody know how can I solve this?
Thank you

I had the same issue, and I knew it was a matter of local configuration since it stopped working suddenly after throwing several commands. So, I fixed it by stopping fabric and tearing it down.
Then, started fabric, created my peer credential and deployed everything again.
Review the commands in here (section: Controlling your dev environment):
https://hyperledger.github.io/composer/v0.19/installing/development-tools.html

Related

Debug JRuby rack runtime error in tomcat

We recently upgraded an old rails app from rails 3 to 4.2, along with many other gem updates. Now I can't get my rails app to load any pages. We were on JRuby 9.1.0.0 but upgraded to 9.1.8.0. However, I'm hitting the same problem on both versions.
Once we start tomcat with our latest .war, it runs all the way until I see the INFO: Server startup in 1234ms message. I've added some debug statements in my rails environment / initializers files to follow it through and it is hitting each of them. So once I see the startup message from tomcat, I figured it would be okay. However, it immediately spits out the following message quite a few times:
DEBUG: resetting rack response due exception
Every time I load a URL, it also shows that message in my logs.
I see that it's from this jruby-rack class but I have no idea how to debug or troubleshoot this further.
I assume that something in my configuration is causing a problem or that a class/module is somehow short-circuiting it but I'm not sure how to identify which one it is or isolate the issue.
Does anybody know of a way to get some more verbose logs or ways to figure out where the problem is happening?
Happy to post any config/gemfiles etc if it will help.
After receiving some great help from the #jruby IRC channel, they mentioned the error message was missing the specific exception message. I was using the latest version, v1.1.21 so I just made a hack-build that added some logging to identify my problem further. Turns out it was a runtime error because of some missing config.
I made an issue with jruby-rack and a PR which will hopefully make its way into the next release!

Elastic Beanstalk stops at EbExtensionPostBuild

I am having a problem deploying an EB instance with a custom .ebextensions file. This is the relevant part in that file:
container_commands:
01_migrate:
command: 'python db_migrate.py'
02_npm_build:
command: 'npm install && npm run prod'
As you can see, these commands are for migrating my PostgreSQL database (via a Flask backend) and building my React .jsx files.
If I leave these commands out, the deployment completes perfectly well. However, once I put them in, looking at the eb-activity.log it stalls at this part forever (as far as I can tell):
[2017-04-10T02:39:24.106Z] INFO [3023] - [Application deployment app-613e-170409_223418#1/StartupStage0/EbExtensionPostBuild] : Starting activity...
I also get this message on the Health overview in the console (this is after 1 day):
Performing application deployment (running for 1 day).
I have also tried to deploy it without those container_commands, and then including it back after the successful initial deployment. Then I get the same error message as before in eb-activity.log, and I also get this message on the Health overview:
Incorrect application version "app-2a3d-170409_214923" (deployment 1). Expected version "app-2a3d-170409_214923" (deployment 1).
Which is very strange because those two versions referenced are the same versions. I don't know what this means!
I found a solution.
Remove all you container_commands from .ebextensions/
Go ssh to instance, kill process with.
sudo killall python
Then Deploy new version without container_commands.
And start debuging all your container_commands, one by one on ssh..
Have fun.

Error in AWS ElasticBeanStalk python 27 application that was running fine

I had an py27 application running on aws ElasticBeanStalk for over a year. Recently it stopped working. So I tried to redeploy. During redeploy I got the following error in the logs:
Return code: 1 Output: [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/03deploy.py]
command failed with error code 1:
/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py
New python executable in /opt/python/run/venv/bin/python27
Not overwriting existing python script /opt/python/run/venv/bin/python
(you must use /opt/python/run/venv/bin/python27)
Can somebody tell me where I will find /opt/python/run/venv/bin/python? How can I change it to
/opt/python/run/venv/bin/python27?
Thanks
When you redeployed, you opted into the latest beanstalk version, which uses a different AMI than the one originally used. If you're familiar with the concept of ebextensions then you're probably looking to add a file like this:
.ebextensions/python.config:
ln -s /opt/python/run/venv/bin/python27 /opt/python/run/venv/bin/python

Upgrading to Ansible 2.0 with Digital Ocean api v2 Issues

I have a working vagrant + ansible setup to provision my digital ocean, it was running on api v1, but when DO deprecated it I got an error message telling me there was no support for v1 anymore. After a research I found out I needed to upgrade to ansible 2.0 + update my digital_ocean.py since the older one was still using client_id and api_key, the new one however now uses the api_token.
Basically I've updated
1.digital_ocean.py which I got from ansible repo module
2. digital_ocean.ini to contain the api_token
3. updated my api token from DO to make sure it's using the new one
but when I execute my ansible playbook I initially got this error
ERROR! The file provisioning/inventory/staging/digital_ocean.py looks like it should be an executable inventory script, but is not marked executable. Perhaps you want to correct this with `chmod +x provisioning/inventory/staging/digital_ocean.py`?
So naturally had to chmod +x it but when I did I get a new error which is
ERROR! The file provisioning/inventory/staging/digital_ocean.py is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with `chmod -x provisioning/inventory/staging/digital_ocean.py`.
ERROR! Inventory script (provisioning/inventory/staging/digital_ocean.py) had an execution error:
ERROR! provisioning/inventory/staging/digital_ocean.py:3: Error parsing host definition ''''': No closing quotation
The next one seem to be json parsing related, my only problem is that it's on line 3 which if you check on the code itself are still on the comment side
https://raw.githubusercontent.com/ansible/ansible/devel/contrib/inventory/digital_ocean.py
I received both errors mentioned and solved them with the following:
The dopy related error was due to the fact that my python and pip were installed differently. dopy was installed via pip which was installed via homebrew. I was using the system python. When I installed python via homebrew, the script found dopy just fine.
Regarding the second error, that is the result I got when not setting the DO_API_TOKEN. I set mine in the command itself with:
DO_API_TOKEN=<api_token> ansible -i digital_ocean.py all -m ping

deploying YouTrack6 on OpenShift

Some time ago, I've deployed a YouTrack5 instance on OpenShift, using this excellent tutorial. It works fine and smoothly.
Now, I want to install YouTrack6. Unfortunately, the same method can't be used for it, as since version 6 YouTrack .war file is no longer available.
So, I've tried to deploy YouTrack6 jar via a DIY cart, which should be ok, as the jar can be run standalone.
This is the command line that I've provided in the
.openshift/action_hooks/start script:
nohup /usr/lib/jvm/java-1.7.0/bin/java -Xmx1g -XX:MaxPermSize=250m -Djetty.home=$OPENSHIFT_DATA_DIR -Duser.home=$OPENSHIFT_DATA_DIR -Ddatabase.location=${OPENSHIFT_DATA_DIR}teamsysdata -Djava.awt.headless=true -jar ${OPENSHIFT_REPO_DIR}youtrack-6.0.12463.jar ${OPENSHIFT_DIY_IP}:${OPENSHIFT_DIY_PORT} &
Indeed, it works, the application is deployed and started - BUT: it is very unstable, looks like it crashes and caused to restart after just every few actions.
From the logs, I couldn't understand where the problem lies, looks like on YouTrack's side everything's ok.
My question is - what can be the problem that causes this unstable behavior, and is there any way to work around it (maybe by changing the command line flags, etc.)?