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.

Feathers error 409 - conflict: message 'follows: null already exists''

See original GitHub issue

I’m facing very strange problem.

when I run ‘create’ from my client on a service, Always return error with a message ‘follows: null already exists’ my service is very simple

import mongooseService from 'feathers-mongoose';
import PostModel from './postmodel';
export default function postService() {
 const app = this;
 app.service('/post', mongooseService({Model: PostModel}));
// apply no hooks
}
// the model 
import mongoose from 'mongoose';
const Schema= mongoose.Schema;
const PostSchema = new Schema({
 title: { type: String},
content: { type: String} 
// that's all 
});
const PostModel = mongoose.model('Post', PostSchema);
export default PostModel;

Please help if you have a solution.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
BodhiHucommented, Mar 8, 2018

Hi,

you can log onto mongodb to check the indexes:

# mongo yourdb -u yourname -p pwd
> db.yourcollections.getIndexes/dropIndexes

Then restart mongod and your server

Thanks

4reactions
HurmisIndiacommented, Apr 29, 2020

@daffl I’ve been slightly spamming slack and I really apologise for that.

This issue I am getting is kind of similar to the one here.

I am currently able to create one MongoDB user, along with an _id of type ObjectId,

I am able to authenticate my user, and use that authentication to fetch the list of users, this is a user object.

{ "total": 1, "limit": 10, "skip": 0, "data": [ { "_id": "5a9a8c3e4b0aac22847635fe", "updatedAt": "2018-03-03T11:51:26.171Z", "createdAt": "2018-03-03T11:51:26.171Z", "email": "test@test.com", "__v": 0 } ] }

What i am not able to do is create a new user as each time I try I get an error code of 409 with the following response

{ "name": "Conflict", "message": "id: null already exists.", "code": 409, "className": "conflict", "errors": { "id": null } }

I am really sorry for sending so many messages on this, I just really want and need to get my head around what is going on. Thank you very much for providing any insight

I just faced the same problem with one of my collections. First single doc was written correctly but no more new additions were failing with mentioned conflict error. I must mention the schema

{
 fieldOne : String,
 fieldTwo: [String]
}

– that’s it! But any patch or get requests were executing successfully on first record.

My codes are running on localhost and DB on mongo atlas cloud.

After wasting all the energy finally deleted the entire collection.

NOW IT"S WORKING AS DESIRED!

Thank god it was in development phase!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Fix the “409 Conflict” Error (5 Methods) - Kinsta
The "409 conflict" error can be frustrating, but it is actually easy to fix. Learn how to fix the error using 5 different...
Read more >
Errors | feathers - FeathersJS
Feathers errors contain the following fields: name - The error name (e.g. "BadRequest", "ValidationError", etc.) message - The error message ...
Read more >
409 Conflict - HTTP - MDN Web Docs
The HTTP 409 Conflict response status code indicates a request conflict with the current state of the target resource.
Read more >
Errors · Feathersjs
The following error types, all of which are instances of FeathersError are ... will already send Conflict or Unprocessable errors with the validation...
Read more >
feathers-mongoose | Yarn - Package Manager
Promise = global.Promise; // Connect to a local database called `feathers` mongoose.connect('mongodb://localhost:27017/feathers'); app.use('/messages', service ...
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