Skip to content

在Halo后台进行部分操作时会返回400 #8438

@cola0908

Description

@cola0908

前置条件

  • 已经在 issues 列表中搜索了相关问题。
  • 这是 Halo 项目本身存在的问题,如果是非项目本身的问题(如:安装部署问题),建议在 Discussions 提交。
  • 已经尝试过停用所有的插件,排除是插件导致的问题。
  • 如果是插件和主题的问题,请在对应的插件和主题仓库提交。

系统信息

使用的哪种方式运行?

Docker

发生了什么?

在Halo后台执行删除文章/页面/插件等操作是会返回400报错
具体报错内容:
Failed to load resource: the server responded with a status of 400 () /apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1 Failed to load resource: the server responded with a status of 400 () /apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1 Failed to load resource: the server responded with a status of 400 () /apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1 Failed to load resource: the server responded with a status of 400 () /apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1 Failed to load resource: the server responded with a status of 400 () components.af854b66.js:1 Failed to execute onConfirm: decode: "ERR_BAD_REQUEST"config: {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}message: "Request failed with status code 400"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: true, upload: XMLHttpRequestUpload, …}response: {data: '', status: 400, statusText: '', headers: r, config: {…}, …}status: 400stack: "AxiosError: Request failed with status code 400\n at Xe (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:32059)\n at XMLHttpRequest.y (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:36898)\n at e.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:49272)\n at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3448)\n at Generator.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:4779)\n at Generator.throw (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3858)\n at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:9996)\n at s (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:10235)"[[Prototype]]: Error c @ components.af854b66.js:1 overview:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received /apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1 Failed to load resource: the server responded with a status of 400 () components.af854b66.js:1 Failed to execute onConfirm: decode: "ERR_BAD_REQUEST"config: {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}message: "Request failed with status code 400"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: true, upload: XMLHttpRequestUpload, …}response: {data: '', status: 400, statusText: '', headers: r, config: {…}, …}status: 400stack: "AxiosError: Request failed with status code 400\n at Xe (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:32059)\n at XMLHttpRequest.y (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:36898)\n at e.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:49272)\n at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3448)\n at Generator.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:4779)\n at Generator.throw (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3858)\n at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:9996)\n at s (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:10235)"[[Prototype]]: Error c @ components.af854b66.js:1

Image

复现步骤

1.打开Halo后台
2.点击文章/页面/插件
3.随便删除一个文章/页面/插件
4.报错返回400

相关日志输出

docker无error日志,浏览器控制台报错:
Failed to load resource: the server responded with a status of 400 ()
/apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1  Failed to load resource: the server responded with a status of 400 ()
/apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1  Failed to load resource: the server responded with a status of 400 ()
/apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1  Failed to load resource: the server responded with a status of 400 ()
/apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1  Failed to load resource: the server responded with a status of 400 ()
components.af854b66.js:1 Failed to execute onConfirm:  decode: "ERR_BAD_REQUEST"config: {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}message: "Request failed with status code 400"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: true, upload: XMLHttpRequestUpload, …}response: {data: '', status: 400, statusText: '', headers: r, config: {…}, …}status: 400stack: "AxiosError: Request failed with status code 400\n    at Xe (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:32059)\n    at XMLHttpRequest.y (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:36898)\n    at e.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:49272)\n    at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3448)\n    at Generator.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:4779)\n    at Generator.throw (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3858)\n    at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:9996)\n    at s (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:10235)"[[Prototype]]: Error
c @ components.af854b66.js:1
overview:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
/apis/content.halo.run/v1alpha1/singlepages/019cf6be-35d2-756c-bcfe-ad233982ccd6:1  Failed to load resource: the server responded with a status of 400 ()
components.af854b66.js:1 Failed to execute onConfirm:  decode: "ERR_BAD_REQUEST"config: {transitional: {…}, adapter: Array(3), transformRequest: Array(1), transformResponse: Array(1), timeout: 0, …}message: "Request failed with status code 400"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: true, upload: XMLHttpRequestUpload, …}response: {data: '', status: 400, statusText: '', headers: r, config: {…}, …}status: 400stack: "AxiosError: Request failed with status code 400\n    at Xe (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:32059)\n    at XMLHttpRequest.y (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:36898)\n    at e.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:49272)\n    at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3448)\n    at Generator.<anonymous> (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:4779)\n    at Generator.throw (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:3858)\n    at p (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:9996)\n    at s (https://cola0908.top/console/assets/axios/axios.9231872f.js:2:10235)"[[Prototype]]: Error
c @ components.af854b66.js:1

附加信息

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions