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

Improve logging for WOPI Parser #3252

Merged
merged 2 commits into from Oct 23, 2023
Merged

Improve logging for WOPI Parser #3252

merged 2 commits into from Oct 23, 2023

Conversation

R0Wi
Copy link
Member

@R0Wi R0Wi commented Oct 23, 2023

Summary

Improve logging to be able to troubleshoot problems with WOPI discovery. If an admin sees a message like this in the logs:

[richdocuments] Error: Exception: Could not find urlsrc in WOPI

this usually means, that the WOPI discovery response was faulty.

A valid discovery response, which is received here, looks like this:

<wopi-discovery>
    <net-zone name="external-http">
        <app name="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
            <action default="true" ext="" name="edit" urlsrc="https://<NC_URL>/custom_apps/richdocumentscode/proxy.php?req=/browser/<TOKEN>/cool.html?"/>
        </app>
        <!-- Many more app entries ...-->
    </net-zone>
</wopi-discovery>

Im my case (because of some backend server error) the response was:

<html><body>
<h1>Socket proxy error</h1>
<p>Error: Timed out opening local socket: 99 - Cannot assign requested address</p>
</body></html>

but I wasn't able to see this message until I added the logging lines of this PR.

Unfortunately this faulty response gets cached for 1h. The workaround to clear the cache is currently to save the richdocument admin settings again.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

Signed-off-by: Robin Windey <ro.windey@gmail.com>
lib/WOPI/Parser.php Outdated Show resolved Hide resolved
@juliushaertl
Copy link
Member

That makes a lot of sense. I even think we can increase the level to error for the one message.

Co-authored-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Robin Windey <ro.windey@gmail.com>
@R0Wi R0Wi merged commit 8e66d4a into main Oct 23, 2023
52 checks passed
@delete-merged-branch delete-merged-branch bot deleted the improve-logging branch October 23, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants