Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: duplicate key value violates unique constraint "mat-change_pkey" #35

Closed
BerkeleyTrue opened this issue Oct 15, 2014 · 2 comments
Closed

Comments

@BerkeleyTrue
Copy link
Contributor

Using loopback 2.4.1
loopback-connector-postgresql 1.1.4

Start with empty database set up with automigrate. Have a model with change tracking enabled. Create a new model. Model is successfully created. Then server crashes with the following error. Seems to also create the change model in the database.

Error: error: duplicate key value violates unique constraint "mat-change_pkey"
    at cb (/Users/berkeley/node/loopback/gems/node_modules/loopback/lib/models/change.js:170:19)
    at /Users/berkeley/node/loopback/gems/node_modules/loopback-datasource-juggler/lib/dao.js:173:20
    at /Users/berkeley/node/loopback/gems/node_modules/loopback-connector-postgresql/lib/postgresql.js:280:14
    at null.callback (/Users/berkeley/node/loopback/gems/node_modules/loopback-connector-postgresql/lib/postgresql.js:143:5)
    at Query.handleError (/Users/berkeley/node/loopback/gems/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/query.js:99:17)
    at null.<anonymous> (/Users/berkeley/node/loopback/gems/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/client.js:167:26)
    at emit (events.js:95:17)
    at Socket.<anonymous> (/Users/berkeley/node/loopback/gems/node_modules/loopback-connector-postgresql/node_modules/pg.js/lib/connection.js:109:12)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:764:14)
@BerkeleyTrue
Copy link
Contributor Author

This seems to be a problem with the loopback change model, as switching to mongodb has the same issue. Will file an issue there.

@BerkeleyTrue
Copy link
Contributor Author

Solved: strongloop/loopback#668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant