question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.5.0: Command renameCollection failed: target namespace exists.

See original GitHub issue

Greetings folks -

Just tried your new 0.5.0 release and getting the following error:

Failed to configure mongo connection: Command renameCollection failed: target namespace exists.

Here’s my code for reference:

try
                {
                    HostingEnvironment.RegisterObject(this);
                    Log.InfoFormat("Configuring Mongo connection: {0}", Config.HangfireDatabaseConnectionString);
                    if (GlobalConfiguration.Configuration == null)
                        throw new Exception("Hangfire.GlobalConfiguration.Configuration is null!");

                    var migrationOptions = new MongoMigrationOptions
                    {
                        Strategy = MongoMigrationStrategy.None
                    };
                    var storageOptions = new MongoStorageOptions
                    {
                        MigrationOptions = migrationOptions
                    };

                    GlobalConfiguration.Configuration.UseMongoStorage(Config.HangfireDatabaseConnectionString, Config.HangfireDatabase, storageOptions);
                    
                }
                catch (Exception e)
                {
                    Log.ErrorFormat("Failed to configure mongo connection: {0}", e.Message);
                    throw;
                }

The error persists even after manually deleting all prior collections (hangfire.* only) in the hangfire db. Note that my hangfire db has 2 other collections (as seen below)

screen shot 2017-08-21 at 3 52 14 pm

These are unrelated to Hangfire.Mongo and I need to preserve them - so I did not delete them.

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
axle-hcommented, Aug 31, 2017

0.5.1 seems to have fixed this issue thanks

1reaction
MarLoecommented, Aug 31, 2017

@rajivkukreja, seems like you reopened the wrong issue. I am reopening this instead: #70 and closing this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

0.5.0: Command renameCollection failed: target ...
0 release and getting the following error: Failed to configure mongo connection: Command renameCollection failed: target namespace exists.
Read more >
How do I rename a mongo collection in Mongoid?
10027 – Raised if the target namespace exists and dropTarget is either ... renaming the collection to artist_lookups on your MongoDB server, ...
Read more >
[#SERVER-60632] Inconsistent error on mongos when ...
When renaming a collection to a target that already exists (without specifying dropTarget) renameCollection will fail with the following: ...
Read more >
renameCollection — MongoDB Manual
Starting in MongoDB 5.0, you can use the renameCollection command to change the name of a sharded collection. The target database must be...
Read more >
tsuru Documentation
You manage your app using the tsuru command-line ... we will get another error: “Table 'blogsql.django_session' doesn't exist”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found