How to resolve the replication error ‘Method Not Allowed [405]’

Shani Attias
2021-04-05 09:21

The replication error attached below usually indicates that the Target repository (shani-replication) is missing in the Target replication instance (http://shani.artifactory:8081)

2021-04-05T08:33:00.029Z [jfrt ] [ERROR] [6d2d64886072178e] [o.a.a.c.BasicStatusHolder:211 ] [ event replication 1] - Error while deploying item 'generic-local:test.txt on Url:http://shani.artifactory:8081/artifactory/shani-replication/ ': Method Not Allowed [405]

To verify that we should find the corresponding error in the Target instance logs.

We expect to find the below error in artifactory-service.log:
2021-04-05T08:33:00.011Z [jfrt ] [WARN ] [6d2d64886072178e] [o.a.w.s.RequestUtils:157      ] [http-nio-8081-exec-7] - Request /shani-replication/test.txt should be a repo request and does not match any repo key

 

We also see the failed request in artifactory-request.log:
2021-04-05T08:33:00.019Z|6d2d64886072178e|12.12.12.12|admin|PUT|/shani-replication/test.txt|405|0|0|8|Artifactory/7.12.6 71206900

The log entry “should be a repo request and does not match any repo key” indicates that the referenced repository does not exist.

 

To resolve the above error we simply need to create the target repository in the target instance or, reconfigure the replication to an existing repository.

 

This behavior can occur if we have misconfigured the replication by using a non-existing endpoint, or when the Target repository was deleted after the replication was already configured.