UPM fails to upgrade plugins with Unexpected token message on console
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Sometimes UPM fails to upgrade plugins and a popup error message appears. It says it failed and to check the Confluence logs but the logs have no errors.
Environment
Confluence 7.x
Diagnosis
Open the browser’s console and try to upgrade a plugin. You will observe the following message:
Failed to parse response text: SyntaxError: Unexpected token U in JSON at position 0
Cause
The "Unexpected token U in JSON at position 0" is a typically Javascript error that will show up in your console log if the client has been directed to execute JSON.parse()
on a string beginning with u instead of a stringified object. "u" is typically a stringified version of the undefined primitive.
Solution
- Clear the browser's cache or use the incognito mode
- Try to upgrade the plugins again