Comments (12)
Likely, you are trying to parse as JSON an HTTP response with an error HTTP code and an empty body.
You should be able to log raw response received by your HTTP client, or see it in the Bot API server log with log verbosity level set to 4 or bigger.
from telegram-bot-api.
You should be able to log raw response received by your HTTP client, or see it in the Bot API server log with log verbosity level set to 4 or bigger.
I got the response body and it's really empty. Is there any way to fix this? What could be the problem with a request containing binary data?
from telegram-bot-api.
You received an HTTP error code and error message, which describes the cause of the error, and why the request was incorrect.
from telegram-bot-api.
You received an HTTP error code and error message, which describes the cause of the error, and why the request was incorrect.
No error message, only 400 Bad Request.
from telegram-bot-api.
Then see server logs with big enough verbosity level.
from telegram-bot-api.
Then see server logs with big enough verbosity level.
[ 4][t 5][1709082263.223197460][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 0 with already read length 0
[ 4][t 5][1709082263.223212480][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 1 with already read length 0
[ 4][t 5][1709082263.223227262][HttpReader.cpp:292][!HttpInboundConnection] Parse headers in multipart form data: "content-disposition:form-data; name="method"
[ 4][t 5][1709082263.223249197][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 2 with already read length 0
[ 4][t 5][1709082263.223266363][HttpConnectionBase.cpp:156][!HttpInboundConnection] Can write to the connection
[ 4][t 5][1709082263.223281860][BufferedFd.h:140][!HttpInboundConnection] Nothing to write to [fd:32]
[ 4][t 5][1709082263.223468303][HttpConnectionBase.cpp:102][!HttpInboundConnection] Can read from the connection
[ 4][t 5][1709082263.223514556][BufferedFd.h:206][!HttpInboundConnection] Flush read: +216B[total:216B]
[ 4][t 5][1709082263.223533153][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 2 with already read length 9
[ 4][t 5][1709082263.223549604][HttpReader.cpp:459][!HttpInboundConnection] Get ordinary parameter in multipart form data: "method": "sendVideo"
[ 4][t 5][1709082263.223565101][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 4 with already read length 0
[ 4][t 5][1709082263.223580360][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 1 with already read length 0
[ 4][t 5][1709082263.223596334][HttpReader.cpp:292][!HttpInboundConnection] Parse headers in multipart form data: "content-disposition:form-data; name="chat_id"
"
[ 4][t 5][1709082263.223618745][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 2 with already read length 0
[ 4][t 5][1709082263.223635196][HttpReader.cpp:459][!HttpInboundConnection] Get ordinary parameter in multipart form data: "chat_id": "828772351"
[ 4][t 5][1709082263.223650455][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 4 with already read length 0
[ 4][t 5][1709082263.223665475][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 1 with already read length 0
[ 4][t 5][1709082263.223681688][HttpConnectionBase.cpp:156][!HttpInboundConnection] Can write to the connection
[ 4][t 5][1709082263.223696708][BufferedFd.h:140][!HttpInboundConnection] Nothing to write to [fd:32]
[ 4][t 5][1709082263.223715066][HttpReader.cpp:260][!HttpInboundConnection] Parsing multipart form data in state 1 with already read length 0
[ 4][t 5][1709082263.223734140][HttpConnectionBase.cpp:156][!HttpInboundConnection] Can write to the connection
[ 4][t 5][1709082263.223751544][BufferedFd.h:140][!HttpInboundConnection] Nothing to write to [fd:32]
[ 4][t 5][1709082263.241710901][HttpConnectionBase.cpp:102][!HttpInboundConnection] Can read from the connection
[ 4][t 5][1709082263.241833209][BufferedFd.h:206][!HttpInboundConnection] Flush read: +3672B[total:3672B]
[ 3][t 5][1709082263.241864442][HttpConnectionBase.cpp:134][!HttpInboundConnection] [Error : 400 : Bad Request: Invalid chunk size [size:29215172]]
from telegram-bot-api.
Currently, Bot API server doesn't support https://en.wikipedia.org/wiki/Chunked_transfer_encoding with chunks of length bigger than 15 MB.
You can change the constant in the file td/tdnet/td/net/HttpChunkedByteFlow.h at line 20 from 15 << 20, for example, to 256 << 20 and rebuild Bot API server after the change.
from telegram-bot-api.
Currently, Bot API server doesn't support https://en.wikipedia.org/wiki/Chunked_transfer_encoding with chunks of length bigger than 15 MB. You can change the constant in the file td/tdnet/td/net/HttpChunkedByteFlow.h at line 20 from 15 << 20, for example, to 256 << 20 and rebuild Bot API server after the change.
Good, thank you. But why is the behavior of the local API differs from the global API? It successfully handles these requests
from telegram-bot-api.
At api.telegram.org requests are handled by NGINX and are proxied to the server using Content-Length encoding.
from telegram-bot-api.
At api.telegram.org requests are handled by NGINX and are proxied to the server using Content-Length encoding.
Is it possible to deploy NGINX so that there will be minimal differences from api.telegram.org?
Can you add a recommended config for such cases?
Maybe something like this.
from telegram-bot-api.
I can't help with NGINX deployment for your scenario, but it should be pretty easy.
from telegram-bot-api.
Fixed with NGINX. Thanks for your help!
Maybe something like this.
from telegram-bot-api.
Related Issues (20)
- [Question]: Is `ChatJoinRequest.invite_link` always null for public groups? HOT 1
- How legal is using getChannelDifference for public channels HOT 5
- hajaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
- Does telegram-bot-api still not support uploading files up to 4G? HOT 7
- How to create a service on Ubuntu HOT 1
- Tgram.api
- http proxy does not work! HOT 1
- Message entities are not preserved by `editMessageText` and `editMessageMedia` HOT 2
- Request: Add Possibility for bot to publish/maintain stories in Channels
- NOT: User.language_code described at IETF but only being used as ISO-639? HOT 3
- How should I apply for the API HOT 4
- How can I be sure that Telegram BOT API local server is running properly? HOT 4
- Blockquote HTML syntax issues HOT 1
- pending_update_counts delay HOT 15
- get 404 error on download file! HOT 11
- Bot latency HOT 6
- Failed to forward message: 'Bad Request: message thread not found' HOT 7
- Persistent "ERROR" When Creating Telegram Application HOT 6
- Change the maximum upload size HOT 1
- not able to set more webhooks! HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from telegram-bot-api.