Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
132 views
in Technique[技术] by (71.8m points)

java - unable to parse json when after ec2 ami upgrade

We're running nomad as our container orchestrater and something very bizarre happened when we updated our AMIs to a new version on the worker. When we did the upgrade...we all the sudden started to see Unable to parse JSON from the app (using java8), once we rolled back the AMI, the app started to work again. We went from this one:

cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

to this one:

cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

This one really stumps me as I haven't seen this behavior when running containers yet. How would an OS upgrade cause an application to start failing when it tries to parse json or how it reads json?

any pointers on why this would fail would be great...this one has be stumped...the kernal versions seem to be the same as well: Linux 4.15.0-107-generic x86_64

-------------- EDIT ----------------

so I isolated the code out and ran it on an AMI with 16.04.7 and it does fail on there and does not fail locally or on 16.04.6. I also saw that in this code (legacy code that was inherited) that there are multiple json classes being loaded:

org/json/JSONArray.class
 - ./json-20180813.jar
 - ./rapleaf-api-complete-1.0.jar
 - ./android-json-0.0.20131108.vaadin1.jar

could it be that it using a different class on the other ami or loading them different somehow and the one its loading is causing this issue?

question from:https://stackoverflow.com/questions/65907747/unable-to-parse-json-when-after-ec2-ami-upgrade

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...