{
   "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
   "id": "574061",
   "self": "https://bugs.mojang.com/rest/api/2/issue/574061",
   "key": "BDS-19922",
   "fields": {
      "issuetype": "1",
      "project": "11700",
      "fixVersions": [],
      "resolution": "10001",
      "customfield_10500": {
         "self": "https://bugs.mojang.com/rest/api/2/customFieldOption/10300",
         "value": "Unconfirmed",
         "id": "10300",
         "disabled": false
      },
      "customfield_12800": null,
      "customfield_12602": [],
      "customfield_12601": null,
      "customfield_12604": null,
      "customfield_12603": null,
      "customfield_12606": null,
      "customfield_12605": null,
      "customfield_12608": null,
      "resolutiondate": "2025-01-29T13:21:21.000+0000",
      "customfield_12607": null,
      "customfield_12609": null,
      "workratio": -1,
      "lastViewed": null,
      "watches": {
         "self": "https://bugs.mojang.com/rest/api/2/issue/BDS-19922/watchers",
         "watchCount": 0,
         "isWatching": false
      },
      "created": "2024-12-08T06:52:34.000+0000",
      "customfield_12000": null,
      "customfield_12201": null,
      "customfield_12600": null,
      "labels": [],
      "customfield_11700": "{}",
      "versions": [
         "22594"
      ],
      "issuelinks": [],
      "assignee": null,
      "updated": "2025-01-29T13:21:21.000+0000",
      "status": "5",
      "description": "Not sure if this is an issue related to just the newest version, or if it effects older versions as well. I just encountered this issue when creating a new addon.\r\n\r\nBasically I created an addon that uses the server.net module for the scripting API, which sends a HTTP post request to a web server I have running locally when a player leaves or joins the server. I have tested the addon on the Windows version on BDS (Test Server) and it worked perfectly. Comes time to add it to the live server I have running on Linux, and I have issues.\r\n\r\n\u00a0\r\n\r\nThe server console tells me that the addon has loaded sucessfully, and most functions of the addon work perfectly fine. The issues start when this line of code is run.\r\n\r\nconst response = await http.request(req);\r\n\r\nWhich is the line that sends the HTTP post request to the web server. Here is the whole function\r\n\r\n\u00a0\r\nasync function logPlayerJoinOrLeave(player, totalOnline, connectOrDisconect) {\r\n\u00a0 \u00a0 try {\r\n\u00a0 \u00a0 \u00a0 \u00a0 let responseBody = \"API calls quota exceeded! maximum admitted 1 per 3s.\";\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 // Ensure that 'players' and 'key' are not undefined or empty\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (!players || !players.length) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 console.error(\"Error: 'player' field is missing or empty.\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return; // Exit if players is missing or empty\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 const key = \"XXXX\";\u00a0 // Make sure to replace with a valid key if needed\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (!key) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 console.error(\"Error: 'key' field is missing.\");\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 return; // Exit if key is missing\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 var URL = 'http://xxx.xxx.x.xxx:xxxx/LogPlayerActivity?player=' + player + '&totalOnline=' + totalOnline + '&connectOrDisconect=' + connectOrDisconect + '&key=' + key;\u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 URL = URL.replace(/\\s+/g, '%20');\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 const req = new HttpRequest(URL);\u00a0 \u00a0 \u00a0\u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 req.method = HttpRequestMethod.Post;\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 req.headers = [\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 new HttpHeader('accept', 'text/plain'),\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ];\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 // Await the request and log the response or error\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ****//const response = await http.request(req);****\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 responseBody = response.body\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if(responseBody == \"API calls quota exceeded! maximum admitted 1 per 3s.\"){\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 server.system.runTimeout(() => {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 logPlayerJoinOrLeave(player, totalOnline, connectOrDisconect)\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }, 3000);\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0\r\n\u00a0 \u00a0 } catch (error) {\r\n\u00a0 \u00a0 \u00a0 \u00a0 console.error(\"Request failed:\", error); // More detailed error logging\r\n\u00a0 \u00a0 }\r\n}\r\nThis is the event listener that triggers the above function\r\n\r\nworld.afterEvents.playerJoin.subscribe(e => {\u00a0\r\n\u00a0 \u00a0 var player = e.playerName\r\n\u00a0 \u00a0 var totalOnline = world.getAllPlayers().length + 1; \u00a0\r\n\u00a0 \u00a0 var connectOrDisconect = true \u00a0\u00a0\r\n\u00a0 \u00a0 logPlayerJoinOrLeave(player, totalOnline, connectOrDisconect) \u00a0\u00a0\r\n})\r\n\r\nWhen I uncomment the offending line, when a player joins the server their game hangs on \"locating server\". The console says the player has connected and spawned in, and if they click \"cancel\" or close the game the console shows them disconecting. If I try to stop the server using the \"stop\" command after a player attempted to connect, the server also hangs and I have to force close it. And no, the HTTP post request never goes through.\r\n\r\n\u00a0\r\n\r\nNot sure if this is a known bug or if there is a work around, but for now I am not logging player connects or disconnects. I am assuming this is some form of bug since the above code works flawlessly on the Windows version on BDS.\r\n\r\n\u00a0",
      "customfield_11100": 0.0,
      "customfield_11300": null,
      "customfield_11500": null,
      "customfield_12503": null,
      "customfield_12700": "[Briefly describe the bug here]\r\n\r\n*Steps to Reproduce:*\r\n# [Step 1]\r\n# [Step 2]\r\n# [Step 3]\r\n\r\n*Observed Results:*\r\n[Describe what happens]\r\n\r\n*Expected Results:*\r\n[Describe what should happen]\r\n\r\n*Screenshots/Videos attached:* [please attach an image or short video]\r\n\r\n*Notes:*",
      "customfield_12502": null,
      "customfield_12504": null,
      "attachment": [],
      "summary": "server.net module not working as expected on Linux",
      "creator": "JIRAUSER489790",
      "reporter": "JIRAUSER489790",
      "customfield_10002": null,
      "customfield_12501": null,
      "customfield_12500": null,
      "customfield_11601": null,
      "customfield_11600": "0|i2k9dj:",
      "environment": "Linux",
      "customfield_11801": null,
      "customfield_11800": null,
      "customfield_11602": null,
      "customfield_11802": null,
      "comment": {
         "comments": [
            {
               "self": "https://bugs.mojang.com/rest/api/2/issue/574061/comment/1377363",
               "id": "1377363",
               "author": "JIRAUSER788919",
               "body": "_We do not have enough information to reproduce this issue._\r\n\r\nPlease include the following information to help us understand your problem:\r\n{quote}*Steps to Reproduce:*\r\n1. _(Explain what needs to be done for the issue to happen)_\r\n2.\r\n3.\r\n\r\n*Observed Results:*\r\n_(Briefly describe what happens)_\r\n\r\n*Expected Results:*\r\n_(Briefly describe what should happen)_\r\n{quote}\r\nPlease also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.\r\n\r\nRefer to the [*Bug Tracker Guidelines*|https://aka.ms/MCBugTrackerHelp] for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as {*}Incomplete{*}.\r\n\r\n~This issue is being temporarily resolved as {color:#d04437}*Awaiting Response*{color}. Once the requested information has been delivered, the report will be reopened automatically.~\r\n\r\n{*}Quick Links{*}:\r\n\ud83d\udcd3 [Bug Tracker Guidelines|https://aka.ms/MCBugTrackerHelp] \u2013 \ud83d\udce7 [Mojang Support (Technical Issues)|https://aka.ms/Minecraft-Support] \u2013 \ud83d\udce7 [Microsoft Support (Account Issues)|https://support.xbox.com/contact-us/]\r\n\ud83d\udcd3 [Project Summary|https://bugs.mojang.com/projects/BDS/summary] \u2013 \u270d\ufe0f [Feedback and Suggestions|https://aka.ms/MinecraftFeedbackDiscord] \u2013 \ud83d\udcd6 [BDS Wiki|https://minecraft.wiki/w/Bedrock_Dedicated_Server] \u2013 \ud83d\udcd6 [FAQs|https://help.minecraft.net/hc/articles/4408873961869]",
               "updateAuthor": "JIRAUSER788919",
               "created": "2025-01-29T13:21:21.269+0000",
               "updated": "2025-01-29T13:21:21.269+0000"
            }
         ],
         "maxResults": 1,
         "total": 1,
         "startAt": 0
      },
      "votes": {
         "self": "https://bugs.mojang.com/rest/api/2/issue/BDS-19922/votes",
         "votes": 0,
         "hasVoted": false
      }
   },
   "changelog": {
      "startAt": 0,
      "maxResults": 1,
      "total": 1,
      "histories": [
         {
            "id": "3169689",
            "author": "JIRAUSER788919",
            "created": "2025-01-29T13:21:21.279+0000",
            "items": [
               {
                  "field": "resolution",
                  "fieldtype": "jira",
                  "from": null,
                  "fromString": null,
                  "to": "10001",
                  "toString": "Awaiting Response"
               },
               {
                  "field": "status",
                  "fieldtype": "jira",
                  "from": "1",
                  "fromString": "Open",
                  "to": "5",
                  "toString": "Resolved"
               }
            ]
         }
      ]
   }
}