Basic usage throws org.json.JSONException
See original GitHub issueProbably something I’m overlooking but running the most basic example fails for me:
jenkins@5e3eb1c93a51:~$ java -jar jenkins-plugin-manager-1.1.2.jar --war /usr/share/jenkins/jenkins.war --plugin-file /var/jenkins_home/plugins.txt --verbose
File containing list of plugins to be downloaded: /var/jenkins_home/plugins.txt
Reading in plugins from /var/jenkins_home/plugins.txt
No directory to download plugins entered. Will use default of /usr/share/jenkins/ref/plugins
Using update center https://updates.jenkins.io from JENKINS_UC environment variable
Using experimental update center https://updates.jenkins.io/experimental from JENKINS_UC_EXPERIMENTAL environment variable
Using incrementals mirror https://repo.jenkins-ci.org/incrementals from JENKINS_INCREMENTALS_REPO_MIRROR environment variable
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/current/plugin-versions.json
Will use war file: /usr/share/jenkins/jenkins.war
Jenkins version: 2.235.1
No version specific update center for Jenkins version 2.235.1
Retrieving update center information
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:505)
at org.json.JSONObject.<init>(JSONObject.java:215)
at org.json.JSONObject.<init>(JSONObject.java:399)
at io.jenkins.tools.pluginmanager.impl.CacheManager.retrieveFromCache(CacheManager.java:73)
at io.jenkins.tools.pluginmanager.impl.PluginManager.getJson(PluginManager.java:561)
at io.jenkins.tools.pluginmanager.impl.PluginManager.getUCJson(PluginManager.java:591)
at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:141)
at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:112)
at io.jenkins.tools.pluginmanager.cli.Main.main(Main.java:37)
A JSONObject text must begin with '{' at 1 [character 2 line 1]
I’m running this command from inside a docker container using the jenkins/jenkins:2.235.1
image.
Plugin file:
blueocean:1.23.2
configuration-as-code:1.41
gitlab-plugin:1.5.13
ssh-credentials:1.18.1
job-dsl:1.77
What I am doing wrong here?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Org.Json - JSONException Handling - Tutorialspoint
Utility classes of org.json throws JSONException in case of invalid JSON. Following example shows how to handle JSONException.
Read more >unhandled exception org.json.jsonexception - Stack Overflow
Re this exception message: org.json.JSONException: Value A of type java.lang.String cannot be converted to JSONObject. I assume it is thrown by this line:...
Read more >org.json.JSONException java code examples - Tabnine
The JSONException is thrown by the JSON.org classes when things are amiss. Most used methods. printStackTrace · getMessage · <init>. Constructs a new ......
Read more >Uses of Class org.json.JSONException - javadoc.io
Uses of JSONException in org. json. The JSONPointerException is thrown by JSONPointer if an error occurs during evaluating a pointer.
Read more >Use org.openqa.selenium.json.JsonException in JUnit With ...
It is an example code of JsonException which has been thrown by selenium client if the response data is not in Json format....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1 same here.
looks like the json files
updateCenter.post({.....
that causes the JSON parser to exit.in my case a workaround was to point the command to these versions of the json files:
Here is my command with the adapted json files
Closed by https://github.com/jenkinsci/plugin-installation-manager-tool/pull/157