[Bug] Getting syntax error in web client when trying to prompt
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
提交前确认 · Pre-submission checklist
- 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
- 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category
稳定性 / 崩溃 · Stability / Crash
涉及的 Agent 框架 · Agent framework
不涉及框架 · Not framework-specific
严重程度 · Severity
轻微 · Minor (小问题不影响主流程 / minor, no impact on main flow)
复现频率 · Reproducibility
偶现 · Sometimes
问题描述 · Description
I don't know if this is consistently reproducible, but noticed same issues being reported in reddit. This is occuring in the web client.
SyntaxError: Unexpected token '<', "<!doctypeh"... is not valid JSON
The above is the error i'm getting just trying to prompt.
Can't attach HAR file due to privacy reasons.
Completions end point returns this as response
<!doctypehtml>
<html lang="zh-cn">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="data-spm" content="a3c0e">
<title>405</title>
<style>
a,body,div,h2,html,p {
margin: 0;
padding: 0
}
a {
text-decoration: none;
color: #3b6ea3
}
.container {
width: 1000px;
margin: auto;
color: #696969
}
.header {
padding: 110px 0
}
.header .message {
height: 36px;
padding-left: 120px;
background: url(https://errors.aliyun.com/images/TB1TpamHpXXXXaJXXXXeB7nYVXX-104-162.png) no-repeat 0 -128px;
line-height: 36px
}
.main {
padding: 50px 0;
background: #f4f5f7
}
#block_image {
position: relative;
left: 120px
}
</style>
<body data-spm="7663354">
<div data-spm="1998410538">
<div class="header">
<div class="container">
<div class="message">
<div id="block_message"></div>
<div>
<span id="block_url_tips"></span>
<strong id="url"></strong>
</div>
<div>
<span id="block_time_tips"></span>
<strong id="time"></strong>
</div>
<div>
<span id="block_traceid_tips"></span>
<strong id="traceid"></strong>
</div>
</div>
</div>
</div>
<div class="main">
<div class="container">
<img id="block_image">
</div>
</div>
</div>
<script>
function getRenderData() {
var e = document.getElementById("renderData");
return JSON.parse(e.innerHTML)
}
function convertTimestampToString(e) {
e = parseInt(e, 10),
e = new Date(e);
return e.getFullYear() + "-" + ("0" + (e.getMonth() + 1)).slice(-2) + "-" + ("0" + e.getDate()).slice(-2) + " " + ("0" + e.getHours()).slice(-2) + ":" + ("0" + e.getMinutes()).slice(-2) + ":" + ("0" + e.getSeconds()).slice(-2)
}
var en_tips = {
block_message: "Sorry, your request has been blocked as it may cause potential threats to the server's security.",
block_url_tips: "Current URL: ",
block_time_tips: "Request Time: ",
block_traceid_tips: "Your Request ID is: "
}
, cn_tips = {
block_message: "很抱歉,由于您访问的URL有可能对网站造成安全威胁,您的访问被阻断。",
block_url_tips: "当前网址: ",
block_time_tips: "请求时间: ",
block_traceid_tips: "您的请求ID是: "
};
window.onload = function() {
var t = getRenderData()
, n = "cn";
try {
navigator.language.startsWith("zh") || (n = "en")
} catch (e) {
t.lang && (n = t.lang)
}
if (t) {
var e, i = cn_tips, r = document.getElementById("block_image");
for (e in "en" === n ? (i = en_tips,
r.src = "https://g.alicdn.com/sd-base/static/1.0.5/image/405.png",
r.id = "en_block") : r.src = "https://errors.aliyun.com/images/TB15QGaHpXXXXXOaXXXXia39XXX-660-117.png",
i)
document.getElementById(e).innerText = i[e];
n = t.traceid,
r = n.slice(8, 21);
document.getElementById("traceid").innerText = n,
document.getElementById("url").innerText = location.href.split("?")[0],
document.getElementById("time").innerText = convertTimestampToString(r)
}
}
</script>
<textarea id="renderData" style="display:none">{"traceid":"0a0f6bd617841384519971747e4e6f","lang":"en"}</textarea>
复现步骤 · Steps to reproduce
Go to web client
Try to prompt it repeatedly when Model is busy error is thrown.
期望表现 · Expected behavior
Should start working on the request
实际表现 · Actual behavior
Throwing the error SyntaxError: Unexpected token '<', "<!doctypeh"... is not valid JSON and makes the web client unusable for any work
ZCode 版本 · ZCode version
NA
设备 / 系统 / 浏览器 · Device / OS / Browser
PC and macbook/Windows and macOS/Chrome,firefox,safari,opera
截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the web client failure while the model is busy and inspect the completions endpoint response described in the report. Done means repeated prompting no longer leaves the client unusable when the endpoint returns the shown non-JSON 405 HTML response.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100