Skip to main content
Skip table of contents

How to fix RepositoryMovedException error?

The RepositoryMovedException issue is an exception that can occur when using the Post Webhooks for Bitbucket app. It indicates that the repository associated with a webhook configuration has been moved, renamed and deleted. This can happen when repositories are renamed, moved to a different project, or deleted altogether.

This parameter you may see in the older versions of Post Webhooks for Bitbucket before our app became capable of updating configurations when a repository was moved or removed (since 3.12). We added new parameter Disable configuration if project/repository was moved/deleted to the Global settings tab on the Global configurations page.

The best decision here is to update the app to the latest version and fix the highlighted rule on the Global configurations page.

If you see in the Bitbucket logs a RepositoryMovedException it means you have a configuration rule for a repository that was renamed, moved or deleted.

CODE
2020-12-08 06:09:10,060 ERROR [http-nio-7990-exec-21] moveworkforward @1MFI5PBx369x484351x0 grly04 10.10.1.1,127.0.0.1 "GET /plugins/servlet/bitbucket-webhooks/configuration/DO/rawhide-services HTTP/1.1" c.m.b.s.AbstractBitbucketConfigurationService The repository has been moved to MWF/the-magic-repo-new
com.atlassian.bitbucket.repository.RepositoryMovedException: The repository has been moved to MWF/the-magic-repo
    at com.atlassian.stash.internal.repository.DefaultRepositorySupplier.getBySlug(DefaultRepositorySupplier.java:65)
    at com.atlassian.stash.internal.repository.DefaultRepositorySupplier.getBySlug(DefaultRepositorySupplier.java:48)
    at com.atlassian.stash.internal.repository.DefaultRepositorySupplier.getBySlug(DefaultRepositorySupplier.java:21)
    at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)

There are 2 ways to fix this error:

  1. Remove the rule for the old repository key.

  2. Change the configuration rule repository key to the new repository key (works only for renamed or moved repositories).

We propose to delete the rule following the steps below.

Here is an example of how to call REST APIs of Bitbucket Server (works the same way for the 3rd party Apps):

  1. Make sure you are the Bitbucket Global administrator.

  2. Get all configurations using GET http://localhost:7990/bitbucket/rest/webhook/2.0/configurations

  3. Find the necessary repositories and not done the rule ID.

  4. Delete the configuration for old repositories using DELETE http://localhost:7990/bitbucket/rest/webhook/2.0/configurations/{​​​​​​​​​​​​​id}​​​​​​​​​​​​​ where id is the id of the rule.


Global Configurations for Bitbucket admins

Updated:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.