Account


Earned badges

Achievement: Latest Unlocked

Topic Started

Topics
Hi all, I'm trying to get to the bottom of an issue that is occurring with some of our PDF uploads (using multipart/form-data).

Replies Created

0 votes
Thanks Haris for looking into this. Good point about a web test, since I have seen some other forum posts where a corrupted PDF file can cause issues. I successfully uploaded the PDF via the web interface without a problem. The PDF file is just a simple document with only "Test 2" in the body (attached here). Nothing fancy. I initially thought it was something with my request interacting with the package in my sandbox, however, I do get a useful (I think) error if I attempt to upload a base64 encoded copy. (Which I know, you said was not the right way, but was grasping at straws).
SQL> @esign1_base64.sql
Request body>

--THISxisMYxBoundary
Content-Disposition: form-data; name="payload"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

{ "name": "Test_2.pdf"
}
--THISxisMYxBoundary
Content-Disposition: form-data; name="file"; filename="Test_2.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding: base64

JVBERi0xLjUNCiW1tb



l0gL1ByZXYgODIyNjUvWFJlZlN0bSA4MTk4OD4+DQpzdGFydHhyZWYNCjgyODIx
DQolJUVPRg==
--THISxisMYxBoundary--
Response> Status Code: 500
Response> Reason Phrase: Internal Server Error
Response> HTTP Version: HTTP/1.1
Response> Server: nginx
Response> Date: Mon, 14 May 2018 14:56:26 GMT
Response> Content-Type: application/json
Response> Transfer-Encoding: chunked
Response> Connection: close
Response> X-Powered-By: Undertow
Response> Allow: GET, POST, HEAD, PUT, PATCH, DELETE
Response body>
{"technical":"DocumentConversionCommand failed and failed retrieving fallback.","messageKey":"error.internal.default","message":"Unexpected error. We apologize for any inconvenience this may have
caused you, please try again. If the problem persists, please contact our support team.","code":500,"name":"Unhandled Server Error"}

PL/SQL procedure successfully completed.
The above does seem to indicate that it was attempting to upload and then threw a conversion error? As another test, to take anything binary out of the picture I attempted to just upload a simple ascii text file, but still getting a 500. Do you have access to the server logs? Or is there a way I can set a flag to get more debug info?
SQL> @esign_text1.sql
Body Length: 353
URL: https://sandbox.esignlive.com/api/packages/2HmThBe9eZopqozAMY63n6TZ5jY=/documents

----THISxisMYxBoundary
Content-Disposition: form-data; name="payload"
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit


{ "name": "Test1.txt"
}
----THISxisMYxBoundary
Content-Disposition: form-data; name="file"; filename="Test1.txt"
Content-Type: text/plain

This is my sample file content!
----THISxisMYxBoundary--
Response> Status Code: 500
Response> Reason Phrase: Internal Server Error
Response> HTTP Version: HTTP/1.1
Response> Server: nginx
Response> Date: Mon, 14 May 2018 14:57:27 GMT
Response> Content-Type: application/octet-stream
Response> Transfer-Encoding: chunked
Response> Connection: close
Response> X-Powered-By: Undertow
Response> Allow: GET, POST, HEAD, PUT, PATCH, DELETE
Response body>
Response length: 27
500: Unhandled Server Error

PL/SQL procedure successfully completed.

Thanks again!

Attachments
Test_2.pdf81.05 KB
0 votes
Sounds good. I just submitted this one at 1:14 EST. Package id: 2HmThBe9eZopqozAMY63n6TZ5jY=
SQL> @esign_blob1.sql
Request post>
Body Length: 334
Body Length: 82999
Body Length: 26
URL:
https://sandbox.esignlive.com/api/packages/2HmThBe9eZopqozAMY63n6TZ5jY=/document
s

----THISxisMYxBoundary
Content-Disposition: form-data;
name="payload"
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 8bit

{ "name": "Test_2.pdf"
}
----THISxisMYxBoundary
Content-Disposition: form-data; name="file";
filename="Test_2.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding:
binary



----THISxisMYxBoundary--
Response> Status Code: 500
Response> Reason Phrase: Internal Server Error
Response> HTTP Version: HTTP/1.1
Response> Server: nginx
Response> Date: Mon, 14 May 2018 17:14:21 GMT
Response> Content-Type: application/octet-stream
Response> Transfer-Encoding: chunked
Response> Connection: close
Response> X-Powered-By: Undertow
Response> Allow: GET, POST, HEAD, PUT, PATCH, DELETE
Response body>
500: Unhandled Server Error

PL/SQL procedure successfully completed.

0 votes
Hi Haris, did you ever have any luck tracking down the server logs? A colleague of mine issued a similar request close to my example on some local servers (and after putting in some log requests and some back and forth) was able to track down a server log file with the following output: Sorry about the xxxx's. I never know what is sensitive and what isn't.
  
[5/15/18 11:59:48:645 CDT] 0000027a SessionLogger I   ESIGNLIVE_SESSION_ID: 2d09c1bc7f99be57xxxxxxxxxxxxxxxf3af4b9d8786f1,	USER_UID: pXXXXXXXXX,	REQUEST_PATH: (POST) /packages/Se3OwA7y9dvCgcnlS_EXOFVrtBc=/documents
[5/15/18 11:59:48:663 CDT] 0000027a DocumentResou I   BEGIN: com.silanis.esl.rest.resource.DocumentResource@a74e1353.uploadDocument ( null, Se3OwxxxxxxxxxxXOFVrtBc=, '.toString > 50 chars' )
[5/15/18 11:59:48:663 CDT] 0000027a MultiPartRequ E   Could not read value from header: name
[5/15/18 11:59:48:664 CDT] 0000027a DocumentResou I   END: com.silanis.esl.rest.resource.DocumentResource@a74e1353.uploadDocument elapsed (ms): 2
[5/15/18 11:59:48:664 CDT] 0000027a AbstractEslEx I   User: pXXXXXXXXXX | ValidationException : null : returning status: Bad Request : key=error.validation.invalidParameters TechnicalMessage : Unexpected Content-Disposition value for parameter 'name'
It appears that even though we're setting the Content-Disposition similar to the example in the Documentation perhaps we aren't setting it in the right place? According to this note we should be setting Content-Disposition in the HTTP Header, and not necessarily in the body. Does that make sense to you? UTL_HTTP is pretty low level and finicky if I'm not putting things in the right place. Would it be possible for you to confirm where Content-Disposition should be set and what if anything related should be in the body? I was never really sure I understood why there was a name="payload" and a name = "file" in the doc example. Thanks again!

Subscriptions

Topics Replies Freshness Views Users
Hi all, I'm trying to get to the bottom of an issue that is occurring with some of our PDF uploads (using multipart/form-data).
4 5 years 1 month ago 364
Profile picture for user Duo_Liang
18 5 years 11 months ago 2,714
Profile picture for user harishaidary

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.