Conversion Failed - Blank page with message

Issue #2 closed
Oswaldo Rojas created an issue

We have setup a Moodle 3.6 wtih oauth2 service and submitted a docx file to an assignment. (We have submitted using an user that is manual authentication type).

When trying to grade using annotate pdf, a blank page is generated and we can only see this message: Some of the files in this submission can only be accessed by direct download.

The exact error we got is this one:

fileconverter_onedrive/conversionfailed

×Debug info: 
Error code: conversionfailed
$a contents: Array
(
[statusmessage] => The file was not uploaded to Microsoft OneDrive.
)

Stack trace:
line 494 of /lib/setuplib.php: moodle_exception thrown
line 223 of /files/converter/onedrive/classes/converter.php: call to print_error()
line 52 of /files/converter/onedrive/test.php: call to fileconverter_onedrive\converter->serve_test_document()

We got this when trying to run test conversion.

We have searched the exact error and found it in two places, reported by the same person:
1. https://moodle.org/plugins/fileconverter_onedrive?nonjscomment=1&comment_itemid=2102&comment_context=50&comment_component=local_plugins&comment_area=plugin_general&comment_page=1.
2. At https://moodle.org/mod/forum/discuss.php?d=383823

Could you please let us know if there are any extra steps to be performed in Azure/Onedrive side to get this working?

Comments (13)

  1. Neill Magill

    Sometimes the OAuth connections seem to go wrong in Moodle, at which point you need to reconnect them (or sometimes recreate them) to get things working again.

    1. Do you use the core Moodle One Drive repository?
    2. Do you have that set to allow documents to be linked, rather than just using it to upload them into the Moodle file store?
    3. Does it used the same OAuth connection as the document converter? Is the linking still working?

    If your system administrators are getting e-mails with text like:

    The refresh token for one of the OAuth services Microsoft on your site has expired. This will limit the functionality of any plugins that use this service. To fix this issue, visit the OAuth 2 Services configuration page and click on the "Connect system account" icon in the table row for this service. Be sure to login using the same service account for the OAuth system each time.

    it would also support the theory that it is an issue with your OAuth connection.

    Also which version of the document converter are you using?

  2. Oswaldo Rojas reporter
    1. No, not using it. I’ve enabled it now and will re-test.
    2. Ok, when enabling Onedrive I’ve allowed internal and external linking.
    3. Yes.

    Version: 1.1.0 (2019-02-08) 2019020800

  3. Neill Magill

    It looks like I have not yet put the latest version in the repository up into the plugins directory, it does change the way files are uploaded. It is probably worth checking if that fixes the issue.

  4. Oswaldo Rojas reporter

    Hi Neill,

    After we installed the latest version, a few submissions worked fine. But after 3 attempts I started to get the error below after 3/4 minutes waiting in the page “Generating the PDF”

    We will perform more tests, but still not sure what may be. Are you aware of any limitations in the filename? (as in no spaces or special characters?)

    Regards

    Oswaldo

  5. Neill Magill

    The name of the file is not sent to OneDrive (the internal Moodle file hash is used as the name sent to OneDrive) although the original file extension would be used.

  6. Oswaldo Rojas reporter

    Hi,

    Our tests returned mixed results, the issue we had above seemed related to re-conversion of submissions that failed initially, it continued failing even after we change the file that was submitted. It worked fine during my tests when was the first time a user submitted a file, if it was processed fine first attempt, I could change the document of the submission to another file and it was converted.

    Other persons from our team that tested haven't managed to successfully convert any new files, the only files worked were those already converted. In an attempt to convert new file, I did see an output file containing an error. The error details are:

    {"error":{"code":"generalException","message":"Error from Office Service. Url=https:\/\/euc.wordca.officeapps.live.com:973\/wordca\/wordconversionservice.svc\/rest\/ConvertFileUrl HttpCode=OK cert=subject:E=onedrivese@microsoft.com, CN=WordThumbnail-OneDrive, OU=Office Service Infrastructure, O=Microsoft Corporation, L=Redmond, S=Washington, C=US;thumbprint:7BEEDD2DA8FE0F90A72FEBB9C4BDF497E8D8FBDF ResponseHeaders=ResponseCode: Failure\u000d\u000aErrorCode: ErrorCodeLimitExceeded\u000d\u000aIsExpectedFailure: False\u000d\u000aErrorCategory: Fatal\u000d\u000aServiceID: 41ebe1a1-ade2-4042-9d7e-a63e57b12681\u000d\u000aOutputFormat: PDF\u000d\u000aServiceRegion: WestEurope\u000d\u000aConversionTime: 265.6248\u000d\u000aSourceFileDownloadTimeInMs: 312.4719\u000d\u000aDate: Fri, 26 Jul 2019 10:05:47 GMT\u000d\u000aServer: Microsoft-IIS\/8.5\u000d\u000aX-Powered-By: ASP.NET\u000d\u000a","innererror":{"code":"OfficeConversion_ConverterInternal"}}}

    Have you ever faced that issue before?

  7. Neill Magill

    I’m afraid we have not had that.

    The generalException code is documented in the Microsoft Graph API as “An unspecified error has occurred”

    The ErrorCode: ErrorCodeLimitExceeded part suggests it could be that it is not working because of the number of errors you have had (unfortunately there is noting related to is specifically documented about it so I cannot be certain).

    If you contact Microsoft they may be able to give you some more information about what it means.

    Do you have a stack trace for where it got back into the conversion plugin? It maybe that we can improve the error handling of the plugin.

  8. Oswaldo Rojas reporter

    Here is the API call params in the convert API call. Hope this helps. We refrain from sending this to Microsoft at this stage, but we can do later.

    "endpoint" => "https://graph.microsoft.com/v1.0/me/drive/items/0122SJXDOJ6ZLZURM25JGZVXQXKW6OWMA4/content",
    "method" => "get",
    "args" => array(
        "itemid" => "0122SJXDOJ6ZLZURM25JGZVXQXKW6OWMA4",
        "format" => "pdf",
    ),
    "response": "header"
    
  9. Neill Magill

    That does look like a call being made correctly to the API to start a conversion.

    The errors you are getting back are from the Microsoft side though.

  10. Log in to comment