Met error "上传失败 可能是文件体积过大", but fixed with deepseek
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- nginx, typescript
- Ambito
- devops, infrastructure
Direzione di ricerca
Inizia esaminando l’entry point uploadFile mostrato nell’issue e individua la configurazione nginx predefinita del repository, il cui percorso del file non è specificato qui. Riproduci un upload tramite il proxy inverso e verifica la configurazione proposta rispetto all’errore osservato; il lavoro è completo quando la configurazione predefinita gestisce gli upload supportati senza l’errore fuorviante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Using default nginx config for reverse proxy, but meeting errors "上传失败 可能是文件体积过大", have assured that all tailchat concerned containers have been removed and started more than once, error still exists.
After check the source code, found this
export async function uploadFile(
file: File,
options: UploadFileOptions = {}
): Promise<UploadFileResult> {
const form = new FormData();
form.append('file', file);
form.append('usage', options.usage ?? 'unknown');
const uploadFileLimit = getGlobalConfig().uploadFileLimit;
if (file.size > uploadFileLimit) {
// 文件过大
showErrorToasts(
`${t('上传失败, 支持的文件最大大小为:')} ${filesize(uploadFileLimit, {
base: 2,
})}`
);
throw new Error('File Too Large');
}
try {
const { data } = await request.post('/upload', form, {
onUploadProgress(progressEvent) {
if (progressEvent.lengthComputable) {
if (typeof options.onProgress === 'function') {
options.onProgress(
progressEvent.loaded / progressEvent.total,
progressEvent
);
}
}
},
});
return data;
} catch (e) {
showToasts(`${t('上传失败')}: ${t('可能是文件体积过大')}`, 'error');
console.error(`${t('上传失败')}: ${_get(e, 'message')}`);
throw e;
}
}
So I guess this error was not raised by tailchat but nginx.
Whatever, this is a better config for nginx, if here were any mistake, that would all deepseek's fault😁, but I have tested in nginx 1.26.2, here is nothing wrong with it. I suggest @moonrailgun updating nginx default config
Enjoy.
gzip on;
gzip_types
text/css
text/javascript
application/javascript
application/json;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name tailchat.domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name tailchat.domain.com;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers on;
ssl_ecdh_curve secp384r1;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
ssl_certificate /etc/cert/tailchat.domain.com;
ssl_certificate_key /etc/cert/tailchat.domain.com;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_max_temp_file_size 1024m;
client_max_body_size 1024M;
location ~ ^/socket\.io(/|$) {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:11000;
proxy_read_timeout 86400;
}
location / {
proxy_pass http://127.0.0.1:11000;
}
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
access_log /var/log/nginx/tailchat-access.log combined buffer=64k flush=5m;
error_log /var/log/nginx/tailchat-error.log warn;
}
- Lingua principale
- TypeScript
- Stelle
- 3.6k
- Fork
- 398
- Merge medio
- 1h 14m
- PR unite (30g)
- 2
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di msgbyte/tailchat
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
在某些地方用户名中的特殊符号并不能很好的显示 || Special symbols in user names are not displayed well in some places Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di msgbyte/tailchat
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/inspector#2458 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
carbon-design-system/ibm-products#9907 ·