-
-
Notifications
You must be signed in to change notification settings - Fork 308
Plugin is not working
Robin edited this page Dec 30, 2020
·
27 revisions
If you get nullpointerexceptions in the console while the server is running, when using plugin commands, etc. restart the server. These errors happen when the plugin failed to load, so have a look at the console for any errors at startup. It's probably one of the errors below.
If you get MalformedJsonException
, JsonSyntaxException
, Use JsonReader.setLenient(true) to accept malformed JSON
, Not a JSON Object: null
, etc. follow the instructions below
- For v2-pr7 use version beta-32, for v2-pr8, v2-pr9 use 1.0.0-alpha
- Make sure the api is enabled in StaffCP
- Make sure that legacy api is disabled (skip if you are using v2-pr8+)
- The API url should be in this format:
http(s)://yoursite.com/index.php?route=/api/v2/API_KEY
. - Make sure the URL does not redirect. For example, if your website forces
https://
it is very important that the API URL useshttps://
nothttp://
- Go to the address in your browser. Does it work? If it says "invalid api method" somewhere it works (NOT an error). If it works in your browser but not from the plugin, skip the next point
- If you have access to a linux command line, run
curl yourapiurl
, it should say "Invalid API method", if it does not, usecurl -v yourapiurl
to get more information. - Are you using CloudFlare? Either use the non-CloudFlare webserver address in config.yml, or find a way to exempt plugin requests from CloudFlare checks. This CloudFlare support page may help. Example by KentuckyFriedData in discord
- If you are getting
MalformedJsonException: Use JsonReader.setLenient(true)
errors but not using cloudflare it's probably your webhost messing with the plugin's requests. If you are using shared hosting, contact them. - Restart your server, maybe it was an old error
If you need further help, feel free to join our Discord server for support 😃