an920107 / health-care-website

中央大學衛保組網站 NCU Health Care
https://health.ncu.edu.tw
MIT License
2 stars 0 forks source link

[Backend] Uploading attachment failed #81

Closed an920107 closed 2 months ago

an920107 commented 2 months ago

Logs

Error message at web console.

{
    "message": "Request failed with status code 500",
    "name": "AxiosError",
    "stack": "AxiosError: Request failed with status code 500\n    at tT (https://health-dev.squidspirit.com/_next/static/chunks/245-03e9a9a5379ad0c3.js:6:38320)\n    at XMLHttpRequest.c (https://health-dev.squidspirit.com/_next/static/chunks/245-03e9a9a5379ad0c3.js:6:42968)\n    at et.request (https://health-dev.squidspirit.com/_next/static/chunks/245-03e9a9a5379ad0c3.js:6:50703)\n    at async o.upload (https://health-dev.squidspirit.com/_next/static/chunks/2687-cb1c1743b9ddf65b.js:1:15220)",
    "config": {
        "transitional": {
            "silentJSONParsing": true,
            "forcedJSONParsing": true,
            "clarifyTimeoutError": false
        },
        "adapter": [
            "xhr",
            "http",
            "fetch"
        ],
        "transformRequest": [
            null
        ],
        "transformResponse": [
            null
        ],
        "timeout": 0,
        "xsrfCookieName": "XSRF-TOKEN",
        "xsrfHeaderName": "X-XSRF-TOKEN",
        "maxContentLength": -1,
        "maxBodyLength": -1,
        "env": {},
        "headers": {
            "Accept": "application/json, text/plain, */*",
            "Content-Type": "multipart/form-data",
            "X-CSRF-Token": "580e27b4-79d7-4abf-9ecb-acbbd3df2292"
        },
        "method": "post",
        "url": "https://health-dev.squidspirit.com/api/attachment",
        "data": {}
    },
    "code": "ERR_BAD_RESPONSE",
    "status": 500
}

Response

The response from the backend server.

<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
an920107 commented 2 months ago

It seems like to be related with #78.

Xunhaoz commented 2 months ago

Bug was fixed. It happened because of error storing path.