Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in CreateReportEndpoint #3457

Open
RedCrafterHD opened this issue Oct 27, 2023 · 2 comments
Open

Error in CreateReportEndpoint #3457

RedCrafterHD opened this issue Oct 27, 2023 · 2 comments
Labels

Comments

@RedCrafterHD
Copy link

Describe the issue

Hey, i was testing some functions which at first worked fine, but when I tried /report i got an error in game but it was normally shown on the website.

NamelessMC Version

Development version

To Reproduce

I try to report someone and it works on the web end, but for some reason in MC i get "An error occured..."

Expected Behaviour

I was expection some kind of feedback, that i reported someone succsesfully

Screenshots

grafik
grafik
grafik

Additional Information

No response

@supercrafter100
Copy link
Member

Can you please check your server logs for errors from the nameless plugin? And post those here?

@Derkades Derkades added question and removed bug labels Oct 28, 2023
@RedCrafterHD
Copy link
Author

RedCrafterHD commented Nov 6, 2023

Srry for the long wait, here:

16:14:12 [INFO] [RedCrafterHD] <-> ServerConnector [lobby] has connected
16:14:28 [WARNING] [NamelessMC] The website didn't return a valid json response. Run /nlpl last_error to retrieve the full stack trace.
16:15:02 [WARNING] [NamelessMC] com.namelessmc.plugin.lib.nameless-api.exception.NamelessException: Website returned invalid response with code 200.
Website response, after 219ms:
-----------------
ReportCreatedEvent::__construct(): Argument #1 ($username) must be of type string, null given, called in /var/www/homepage/core/classes/Misc/Report.php on line 62 in /var/www/homepage/modules/Core/classes/Events/ReportCreatedEvent.php on line 13
#0 /var/www/homepage/core/classes/Misc/Report.php(62): ReportCreatedEvent->__construct()
#1 /var/www/homepage/modules/Core/includes/endpoints/CreateReportEndpoint.php(83): Report::create()
#2 /var/www/homepage/core/classes/Endpoints/Endpoints.php(69): CreateReportEndpoint->execute()
#3 /var/www/homepage/modules/Core/classes/Misc/Nameless2API.php(52): Endpoints->handle()
#4 /var/www/homepage/modules/Core/pages/api/v2/index.php(23): Nameless2API->__construct()
#5 /var/www/homepage/index.php(133): require('...')
#6 {main}

	at com.namelessmc.plugin.lib.nameless-api.RequestHandler.makeConnection(RequestHandler.java:219)
	at com.namelessmc.plugin.lib.nameless-api.RequestHandler.post(RequestHandler.java:58)
	at com.namelessmc.plugin.lib.nameless-api.NamelessUser.createReport(NamelessUser.java:286)
	at com.namelessmc.plugin.common.command.ReportCommand.lambda$execute$0(ReportCommand.java:65)
	at net.md_5.bungee.scheduler.BungeeTask.run(BungeeTask.java:63)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: com.namelessmc.plugin.lib.gson.JsonSyntaxException: com.namelessmc.plugin.lib.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 20 path $
	at com.namelessmc.plugin.lib.gson.JsonParser.parseReader(JsonParser.java:76)
	at com.namelessmc.plugin.lib.gson.JsonParser.parseString(JsonParser.java:51)
	at com.namelessmc.plugin.lib.nameless-api.RequestHandler.makeConnection(RequestHandler.java:187)
	... 7 more
Caused by: com.namelessmc.plugin.lib.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 20 path $
	at com.namelessmc.plugin.lib.gson.stream.JsonReader.syntaxError(JsonReader.java:1659)
	at com.namelessmc.plugin.lib.gson.stream.JsonReader.checkLenient(JsonReader.java:1465)
	at com.namelessmc.plugin.lib.gson.stream.JsonReader.doPeek(JsonReader.java:551)
	at com.namelessmc.plugin.lib.gson.stream.JsonReader.peek(JsonReader.java:433)
	at com.namelessmc.plugin.lib.gson.JsonParser.parseReader(JsonParser.java:71)
	... 9 more

@Derkades Derkades added bug and removed question labels Nov 16, 2023
@Derkades Derkades changed the title Error when Plugin tries to connect to website on /report Error in CreateReportEndpoint Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants