Confluence REST or Plugin Function Requests Returned 404 Not Found

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  • There are few Confluence functions that are not working properly, such as Copy Page, Move Page
  • Dashboard isn't loaded properly. Popular tab will just stuck at Loading update stream...:
     
  • Each tab in the right hand side of the Dashboard shows the following error:
     

    Failed to retrieve updates
    Updates could not be retrieved at this time. Please try again later.

  • Checking in Chrome's developer tools or Firefox's firebug, will show a lot of 404 returned on REST or plugin requests:

    AJS.Confluence: run binder components batch.js:6confluence-keyboard-shortcuts initialising batch.js:6
    GET http://Confluence-URL/undefined/rest/prototype/1/i18n/com.atlassian.confluence.plugins.share-page 404 (Not Found) batch.js:4
    Error loading I18n for com.atlassian.confluence.plugins.share-page:error batch.js:6
    GET http://Confluence-URL/undefined/rest/popular/1/stream/content?days=7&pageSize=20 404 (Not Found) batch.js:4
    POST http://Confluence-URL/undefined/rest/dashboardmacros/1.0/updates 404 (Not Found) batch.js:4
    Failed to retrieve updates. Status: error, Error: Not Found batch.js:6
    POST http://Confluence-URL/undefined/rest/dashboardmacros/1.0/updates 404 (Not Found) batch.js:4
    Failed to retrieve updates. Status: error, Error: Not Found batch.js:6
    POST http://Confluence-URL/undefined/rest/dashboardmacros/1.0/updates 404 (Not Found) batch.js:4
    Failed to retrieve updates. Status: error, Error: Not Found batch.js:6
    POST http://Confluence-URL/undefined/rest/dashboardmacros/1.0/updates 404 (Not Found) batch.js:4
    Failed to retrieve updates. Status: error, Error: Not Found batch.js:6
    GET http://Confluence-URL/display/ds/undefined/rest/prototype/1/i18n/com.atlassian.confluence.plugins.confluence-like 404 (Not Found) batch.js:4
    Error loading I18n for com.atlassian.confluence.plugins.confluence-like:error batch.js:6
    Uncaught Error: Error downloading translation files for likes plugin. batch.js:345
    POST http://Confluence-URL/display/ds/undefined/plugins/editor-loader/editor.action 404 (Not Found) batch.js:4
    EditorLoader: Error while loading the editor: Error loading the Editor template: 404 - Not Found batch.js:6
    EditorLoader: all 'after load' callbacks have been called. batch.js:6
    GET http://Confluence-URL/display/ds/undefined/plugins/macrobrowser/browse-macros.action 404 (Not Found) batch.js:4
    Error requesting macro browser metadata: batch.js:6
  • As shown above, somehow, there is undefined appended in the resources (e.g. JavaScript, REST) URL being requested by Confluence, which explains the 404 returned.
  • There is nothing in the log.
  • Checking in System Information page which can be accessible through Confluence Admin > System Information, scroll down to 'Modification' table will show that header.vm is modified:
     
  • There is some other custom layout in place.

Cause

This is normally caused when <Confluence-install>/confluence/decorators/includes/header.vm is customised. Or there is an incompatible custom layout.

Resolution

Resolution 1

  1. Revert <Confluence-install>/confluence/decorators/includes/header.vm to its default. Or at least, make sure the following code is in place and not commented:

    header.vm of Confluence 4.3
        #putMetadata('context-path', $req.contextPath)
        #putMetadata('base-url', $globalSettings.baseUrl)
        #putMetadata('version-number', $generalUtil.versionNumber)
        #putMetadata('build-number', $generalUtil.buildNumber)
        #putMetadata('remote-user', $!action.remoteUser.name)
        #putMetadata('static-resource-url-prefix', $staticResourceUrlPrefix)
        #putMetadata('global-settings-attachment-max-size', $globalSettings.attachmentMaxSize)
        #putMetadata('user-locale', $action.locale)
        #putMetadata('enabled-dark-features', $darkFeatures.allEnabledFeaturesAsString)
        #putMetadata('atl-token', $xsrfTokenGenerator.generateToken($req))
        #putMetadata('confluence-flavour', $confluenceFlavour)
  2. Restart Confluence, clear browser cache. If the problem still persists, please try backup any existing custom layout, then reset them and proceed to the next resolution.

Resolution 2

  1. Backup your Confluence database

  2. Run the following query in your Confluence database:

    SELECT * FROM DECORATOR;


    The result of this query displays all the custom layouts applied on your Confluence site. If this query returns one or more rows, please run this query to delete all of the custom layouts:

    DELETE FROM DECORATOR;
  3. Restart your Confluence and see if the issue persists
Last modified on Jun 20, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.