{
  "id": 603895,
  "title": "GatewayRuntimeError",
  "url": "/competitions/rsna-intracranial-aneurysm-detection/discussion/603895",
  "author_name": "NinjaNick",
  "post_date": "2025-09-05T00:14:48.353000",
  "votes": 0,
  "comment_count": 3,
  "views": 0,
  "content": "<p>So, I'm having an issue with the kaggle submission. Again.<br>\nI use this snippet of code for my submission:</p>\n<pre><code>()\n(f)\n(f)  # First 10 files\n\ninference_server = kaggle_evaluation.rsna_inference_server.RSNAInferenceServer(enhanced_predict)\n\n os.getenv():\n    ()\n    inference_server.serve()\n:\n    ()\n    inference_server.run_local_gateway()\n    display(pl.read_parquet())\n</code></pre>\n<p>But the one error I'm getting is:</p>\n<pre><code> &gt;, )\n</code></pre>\n<p>I don't know why this is happening now. It's the same script that I've used for my original submission. Please help</p>",
  "messages": [
    {
      "id": 3283837,
      "postDate": "2025-09-08T01:01:40.093Z",
      "content": "<pre><code>shutil.rmtree(, ignore_errors=)\n</code></pre>\n<p>Run this, if you get the error. This clears the shared directory, which the API expects to be empty when you run the inference server. </p>",
      "rawMarkdown": "```python\nshutil.rmtree('/kaggle/shared', ignore_errors=True)\n```\nRun this, if you get the error. This clears the shared directory, which the API expects to be empty when you run the inference server. ",
      "replies": [
        {
          "id": 3286258,
          "postDate": "2025-09-09T13:48:35.710Z",
          "content": "<p>Even when adding that, the local gateway doesn't work</p>\n<pre><code> (&lt;GatewayRuntimeErrorType.SERVER_MISSING_ENDPOINT: &gt;, \n</code></pre>",
          "rawMarkdown": "Even when adding that, the local gateway doesn't work\n\n```\nGatewayRuntimeError: (<GatewayRuntimeErrorType.SERVER_MISSING_ENDPOINT: 4>, 'Server did not register a listener for predict')\n```",
          "replies": [
            {
              "id": 3287748,
              "postDate": "2025-09-12T06:57:55.707Z",
              "content": "<p>That means you didn't define a predict() function. Your function that does prediction should match exactly as it was in the demo submission file. </p>",
              "rawMarkdown": "That means you didn't define a predict() function. Your function that does prediction should match exactly as it was in the demo submission file. \n"
            }
          ]
        }
      ]
    },
    {
      "id": 3281785,
      "postDate": "2025-09-05T00:14:48.353Z",
      "content": "<p>So, I'm having an issue with the kaggle submission. Again.<br>\nI use this snippet of code for my submission:</p>\n<pre><code>()\n(f)\n(f)  # First 10 files\n\ninference_server = kaggle_evaluation.rsna_inference_server.RSNAInferenceServer(enhanced_predict)\n\n os.getenv():\n    ()\n    inference_server.serve()\n:\n    ()\n    inference_server.run_local_gateway()\n    display(pl.read_parquet())\n</code></pre>\n<p>But the one error I'm getting is:</p>\n<pre><code> &gt;, )\n</code></pre>\n<p>I don't know why this is happening now. It's the same script that I've used for my original submission. Please help</p>",
      "rawMarkdown": "So, I'm having an issue with the kaggle submission. Again.\nI use this snippet of code for my submission:\n```\nprint(\"🔧 SUBMISSION DEBUG INFO\")\nprint(f\"Current working directory: {os.getcwd()}\")\nprint(f\"Files in directory: {os.listdir('.')[:10]}\")  # First 10 files\n\ninference_server = kaggle_evaluation.rsna_inference_server.RSNAInferenceServer(enhanced_predict)\n\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    print(\"🏆 COMPETITION MODE - Starting inference server...\")\n    inference_server.serve()\nelse:\n    print(\"🧪 LOCAL MODE - Running test...\")\n    inference_server.run_local_gateway()\n    display(pl.read_parquet('/kaggle/working/submission.parquet'))\n```\n\nBut the one error I'm getting is:\n```\nGatewayRuntimeError: (<GatewayRuntimeErrorType.GATEWAY_RAISED_EXCEPTION: 5>, \"`file_share_dir` must be an empty directory, instead found ['kaggle']\")\n```\n\nI don't know why this is happening now. It's the same script that I've used for my original submission. Please help"
    }
  ],
  "comments": [
    {
      "id": 3283837,
      "author_name": "Parkhyeryn",
      "author_url": "",
      "post_date": "2025-09-08T01:01:40.093000",
      "content": "<pre><code>shutil.rmtree(, ignore_errors=)\n</code></pre>\n<p>Run this, if you get the error. This clears the shared directory, which the API expects to be empty when you run the inference server. </p>",
      "votes": 0,
      "replies": [
        {
          "id": 3286258,
          "author_name": "NinjaNick",
          "author_url": "",
          "post_date": "2025-09-09T13:48:35.710000",
          "content": "<p>Even when adding that, the local gateway doesn't work</p>\n<pre><code> (&lt;GatewayRuntimeErrorType.SERVER_MISSING_ENDPOINT: &gt;, \n</code></pre>",
          "votes": 0,
          "replies": [
            {
              "id": 3287748,
              "author_name": "Parkhyeryn",
              "author_url": "",
              "post_date": "2025-09-12T06:57:55.707000",
              "content": "<p>That means you didn't define a predict() function. Your function that does prediction should match exactly as it was in the demo submission file. </p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3283837": "```python\nshutil.rmtree('/kaggle/shared', ignore_errors=True)\n```\nRun this, if you get the error. This clears the shared directory, which the API expects to be empty when you run the inference server. ",
    "3281785": "So, I'm having an issue with the kaggle submission. Again.\nI use this snippet of code for my submission:\n```\nprint(\"🔧 SUBMISSION DEBUG INFO\")\nprint(f\"Current working directory: {os.getcwd()}\")\nprint(f\"Files in directory: {os.listdir('.')[:10]}\")  # First 10 files\n\ninference_server = kaggle_evaluation.rsna_inference_server.RSNAInferenceServer(enhanced_predict)\n\nif os.getenv('KAGGLE_IS_COMPETITION_RERUN'):\n    print(\"🏆 COMPETITION MODE - Starting inference server...\")\n    inference_server.serve()\nelse:\n    print(\"🧪 LOCAL MODE - Running test...\")\n    inference_server.run_local_gateway()\n    display(pl.read_parquet('/kaggle/working/submission.parquet'))\n```\n\nBut the one error I'm getting is:\n```\nGatewayRuntimeError: (<GatewayRuntimeErrorType.GATEWAY_RAISED_EXCEPTION: 5>, \"`file_share_dir` must be an empty directory, instead found ['kaggle']\")\n```\n\nI don't know why this is happening now. It's the same script that I've used for my original submission. Please help"
  }
}