Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated curl behaves different to insomnia, causing a server error due to UnexpectedEof #5067

Closed
1 task done
DavidFarago opened this issue Aug 10, 2022 · 1 comment
Closed
1 task done
Labels
B-bug Bug: general classification N-author-input Needs: response from ticket creator S-unverified Status: Unverified by maintainer

Comments

@DavidFarago
Copy link

Expected Behavior

I have a post multipart request with file and one other form parameter, and the request works fine in insomnia.

But when I "copy as curl" the request, I get a 500 error.

Actual Behavior

The same communication with the server when using the generated curl command instead of insomnia, and thus also successful behavior when using the generated curl command.

Reproduction Steps

The server log files show

UNCAUGHT ERROR: UnexpectedEof                                                                                                                                                                                          
│     at MultipartReader.nextPart (https://deno.land/[email protected]/mime/multipart.ts:438:15)                                                                                                                               
│     at async MultipartReader.readForm (https://deno.land/[email protected]/mime/multipart.ts:348:17)                                                                                                                         
│     at async file:///app/src/api.ts:49:18                                                                                                                                                                              
│     at async dispatch (https://deno.land/x/[email protected]/middleware.ts:41:7)                                                                                                                                             
│     at async dispatch (https://deno.land/x/[email protected]/middleware.ts:41:7)                                                                                                                                             
│     at async dispatch (https://deno.land/x/[email protected]/middleware.ts:41:7)                                                                                                                                             
│     at async Application.#handleRequest (https://deno.land/x/[email protected]/application.ts:389:9)    

The generated curl command:

curl --request POST --url 'https://CENSORED.cloud/api/v1/questionnaire?' --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' --form [email protected] --form phase=p2

The output from curl:

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 3.69.193.92:443...
* TCP_NODELAY set
* Connected to qxre-ingest.dev.mediform.cloud (3.69.193.92) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /home/davef/anaconda3/ssl/cacert.pem
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=qxre-ingest.dev.mediform.cloud
*  start date: Jun 25 19:09:18 2022 GMT
*  expire date: Sep 23 19:09:17 2022 GMT
*  subjectAltName: host "CENSORED.cloud" matched cert's "CENSORED.cloud"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
> POST /api/v1/questionnaire? HTTP/1.1
> Host: CENSORED.cloud
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 5068
> Content-Type: multipart/form-data; boundary=---011000010111000001101001; boundary=------------------------099bc922d79bc876
> Expect: 100-continue
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Mark bundle as not supporting multiuse
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Date: Wed, 10 Aug 2022 13:46:56 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 45
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Krakend: Version 1.2.0
< X-Krakend-Completed: false
< Strict-Transport-Security: max-age=15724800; includeSubDomains
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< 
* Connection #0 to host CENSORED.cloud left intact
{"error":{"message":"Internal server error"}}

The log in Insomnia:

> POST /api/v1/questionnaire HTTP/2
> Host: CENSORED.cloud
> user-agent: insomnia/2021.2.2
> content-type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
> accept: */*
> content-length: 1692

| --X-INSOMNIA-BOUNDARY
| Content-Disposition: form-data; name="file"; filename="CENSORED.qxrem"
| Content-Type: application/octet-stream
| Nachrichten für CENSORED
| --X-INSOMNIA-BOUNDARY
| Content-Disposition: form-data; name="phase"
| p2
| --X-INSOMNIA-BOUNDARY--

* We are completely uploaded and fine
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!

< HTTP/2 200 
< date: Wed, 10 Aug 2022 11:04:55 GMT
< content-type: text/plain; charset=utf-8
< content-length: 45
< vary: Accept-Encoding
< x-krakend: Version 1.2.0
< x-krakend-completed: false
< strict-transport-security: max-age=15724800; includeSubDomains
< access-control-allow-origin: *
< access-control-allow-credentials: true


* Received 45 B chunk
* Connection #7 to host CENSORED.cloud left intact

Is there an existing issue for this?

Additional Information

Since I use no metadata, I guess #3868 is not the cause.

Since I use no characters that need escaping, I guess #3868 is not the cause.

Insomnia Version

2021.2.2 Release date: 3/29/2021 OS: Linux x64 5.4.0-122-generic Electron: 9.3.5 Node: 12.14.1 V8: 8.3.110.13-electron.0 Architecture: x64 node-libcurl: libcurl/7.73.0 OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.7 zstd/1.4.9 libidn2/2.0.4 libssh2/1.9.0 nghttp2/1.41.0

What operating system are you using?

Ubuntu

Operating System Version

LTS 2018/4

Installation method

apt

Last Known Working Insomnia version

No response

@DavidFarago DavidFarago added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Aug 10, 2022
@DavidFarago DavidFarago changed the title Generated curl behaves differently Generated curl behaves different to insomnia, causing a server error due to UnexpectedEof Aug 10, 2022
@filfreire
Copy link
Member

Hi @DavidFarago are you still able to reproduce this same error with latest stable Insomnia version (2022.5.0)?

@filfreire filfreire added the N-author-input Needs: response from ticket creator label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification N-author-input Needs: response from ticket creator S-unverified Status: Unverified by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants