[400] Unable to load the document. Unable to load Document(1;DOCUMENT NAME). Unable to open document because it is corrupt or unsupported

Hi everyone,

I have been scratching my head against this issue. I have a Google Drive download a file module. The module doesn’t fail and and extract’s the file but it seems to be formatted in a way that isn’t compatible with docusign when using google docs. Even when I change the advances options and set them all to convert to PDF nothing happens and it still fails.

However when I process a PDF through it then all goes well and the files makes it through the entire flow.

I tried linking IlovePDF and converting to PDF automatically but it also gave me the exact error as docusign so something must be going on with google doc files downloaded that make it incompatible.,

I’d very much appreciate your help.

Thanks a lot!

Drive Input bundle content


[
    {
        "file": "**REDACTED**",
        "select": "map",
        "formatDrawings": "application/pdf",
        "formatDocuments": "application/pdf",
        "formatSpreadsheets": "application/pdf",
        "formatPresentations": "application/pdf"
    }
]

Drive Output bundle content

[
    {
        "kind": "drive#file",
        "id": "1brIbXwZZqe0vjrU6PIUKytSzBVVRxl0a",
        "name": "REDACTED",
        "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "starred": false,
        "trashed": false,
        "explicitlyTrashed": false,
        "parents": [
            "1Nqr7AnH3dDY9sxuy0js2CEZGjf2UpdFf5GzqY3-fVRXT_uEMffMWyeStMExnn1IE7al9lGSn"
        ],
        "spaces": [
            "drive"
        ],
        "version": "161",
        "webContentLink": "https://drive.google.com/uc?id=1brIbXwZZqe0vjrU6PIUKytSzBVVRxl0a&export=download",
        "webViewLink": "https://docs.google.com/document/d/1brIbXwZZqe0vjrU6PIUKytSzBVVRxl0a/edit?usp=drivesdk&ouid=111518471274334533388&rtpof=true&sd=true",
        "iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "hasThumbnail": true,
        "thumbnailLink": "https://lh3.googleusercontent.com/drive-storage/AJQWtBPiXYtpr5ImxZmmK06jxNNUcogNij5Qz2f7i0YVeeR87sFgosl3jg5b6fKA0IDHwOfGxdOUuD0_rKVPZR9ouQ3-hwtWgY8-qRXuAD40BEQF5cE=s220",
        "thumbnailVersion": "10",
        "viewedByMe": true,
        "viewedByMeTime": "2024-09-10T10:06:42.785Z",
        "createdTime": "2024-08-29T11:40:51.239Z",
        "modifiedTime": "2024-09-09T20:39:44.048Z",
        "modifiedByMeTime": "2024-09-09T20:39:44.048Z",
        "modifiedByMe": true,
        "sharedWithMeTime": "2024-08-29T11:40:51.821Z",
        "sharingUser": {
            "kind": "drive#user",
            "displayName": "REDACTED",
            "photoLink": "REDACTED",
            "me": false,
            "permissionId": "REDACTED",
            "emailAddress": "REDACTED"
        },
        "owners": [
            {
                "kind": "drive#user",
                "displayName": "REDACTEDi",
                "photoLink": "REDACTED",
                "me": true,
                "permissionId": "REDACTED",
                "emailAddress": "REDACTED"
            }
        ],
        "lastModifyingUser": {
            "kind": "drive#user",
            "displayName": "REDACTED",
            "photoLink": "REDACTED",
            "me": true,
            "permissionId": "REDACTED",
            "emailAddress": "REDACTED"
        },
        "shared": true,
        "ownedByMe": true,
        "capabilities": {
            "canAcceptOwnership": false,
            "canAddChildren": false,
            "canAddMyDriveParent": false,
            "canChangeCopyRequiresWriterPermission": true,
            "canChangeSecurityUpdateEnabled": false,
            "canChangeViewersCanCopyContent": true,
            "canComment": true,
            "canCopy": true,
            "canDelete": true,
            "canDownload": true,
            "canEdit": true,
            "canListChildren": false,
            "canModifyContent": true,
            "canModifyContentRestriction": true,
            "canModifyEditorContentRestriction": true,
            "canModifyOwnerContentRestriction": true,
            "canModifyLabels": false,
            "canMoveChildrenWithinDrive": false,
            "canMoveItemIntoTeamDrive": true,
            "canMoveItemOutOfDrive": true,
            "canMoveItemWithinDrive": true,
            "canReadLabels": false,
            "canReadRevisions": true,
            "canRemoveChildren": false,
            "canRemoveContentRestriction": false,
            "canRemoveMyDriveParent": true,
            "canRename": true,
            "canShare": true,
            "canTrash": true,
            "canUntrash": true
        },
        "viewersCanCopyContent": true,
        "copyRequiresWriterPermission": false,
        "writersCanShare": true,
        "permissions": [
            {
                "kind": "drive#permission",
                "id": "03393243565384990291",
                "type": "user",
                "emailAddress": "gorata@carry1st.com",
                "role": "writer",
                "displayName": "Gorata Makepe",
                "photoLink": "https://lh3.googleusercontent.com/a/ACg8ocJKRBwEGFp_w6vK9jqa8HmMAxVyvX1O3R9pBaXa2gm2j0Hcjw=s64",
                "deleted": false,
                "pendingOwner": false
            },
            {
                "kind": "drive#permission",
                "id": "REDACTED",
                "type": "user",
                "emailAddress": "REDACTED",
                "role": "owner",
                "displayName": "REDACTED",
                "photoLink": "REDACTED",
                "deleted": false,
                "pendingOwner": false
            },
        ],
        "permissionIds": [
            "REDACTED",
          
        ],
        "originalFilename": "REDACTED",
        "fullFileExtension": "docx",
        "fileExtension": "docx",
        "md5Checksum": "836bc97996c239cbbf5a15bb6f3dfcd8",
        "size": "438152",
        "quotaBytesUsed": "438152",
        "headRevisionId": "0B_hKT1JzcJnoNEV3SlYwQzVsSzdEbmYraENXYVR4NWoxSFZRPQ",
        "isAppAuthorized": false,
        "linkShareMetadata": {
            "securityUpdateEligible": false,
            "securityUpdateEnabled": true
        },
        "data": "IMTBuffer(438152, binary, 48cf97c7c8de0597808709f6780ac41977a7b026): 504b0304140008080800922e295900000000000000000000000010000000776f72642f666f6f746572312e786d6ce597db6e1a311040bfa0ff80fc9eec8292285905a236b451a53ea034fd0063cfeebaf14d6303215f5fef95006964681e2295975de672",
        "filesize": 438152
    }
]

** Docusign Input bundle content:**


[
    {
        "status": false,
        "documents": [
            {
                "name": "REDACTED",
                "documentId": "1",
                "documentBase64": "IMTBuffer(438152, binary, 48cf97c7c8de0597808709f6780ac41977a7b026): 504b0304140008080800922e295900000000000000000000000010000000776f72642f666f6f746572312e786d6ce597db6e1a311040bfa0ff80fc9eec8292285905a236b451a53ea034fd0063cfeebaf14d6303215f5fef95006964681e2295975de672"
            }
        ],
        "recipients": {
            "Signers": [
                {
                    "name": "REDACTED",
                    "tabs": {},
                    "email": "REDACTED",
                    "recipientId": "1",
                    "addAccessCodeToEmail": false
                }
            ]
        },
        "emailSubject": "Complete via Docusign: REDACTED",
        "select_account": "{ \"accountId\": \"*REDACTED\", \"baseUri\": \"https://eu.docusign.net\" }"
    }
]

** Docusign Output Bundle content**

[
    null
]

Welcome, @Souhail.

I think GDrive is converting the file to PDF for you, but the link for DocuSign is buried in the output. The video will show where to look.

Simple example blueprint.json (7.0 KB)

Thanks a lot Michael. You are very kind. Going above and beyond to include a video and the blueprint. Unfortunately it still isn’t working. Even on a blank project using your blueprint but linking to my corp Gdrive.

On my end in my output bundle I don’t see the Export links collection at all. See screenshot with red arrow that’s where it shows up on your end. In the docusign module when I search for it, it shows up, but as empty fields. This is quite odd and might be the source of the issue. I tried direct linking to a test google doc file and it still fails so the issue isn’t the variable ID extraction formula I have in place either. I also relinked my google account in case there were some issues with permission the first time around but still no luck.

Any suggestions as to how I can fix this? Much appreciated.

Thank you for the kind words, @Souhail.

I’m guessing here, are you publicly sharing the Google Drive files? When not, I could understand why Export Links are missing.

Solution found! It turns out the issue was that the set of google docs were .docx format, which is used in Microsoft Word for documents.

In this case, Google Drive won’t work very well; it will only download the actual file, as Google Drive can only convert Google Docs files (the same cloud ecosystem).

In this case, I added another module that can convert these files for me, like PDF.co. I had tried this previously with ilovePDF but it also failed and I got side tracker thinking it was a bug or something. For anyone else reading this trying pdf.co or other file conversion tools that work for you.

Cheers!

2 Likes