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

Ahoy error (ID constraint) #379

Closed
differentreality opened this issue Jul 27, 2014 · 17 comments
Closed

Ahoy error (ID constraint) #379

differentreality opened this issue Jul 27, 2014 · 17 comments
Assignees
Labels
bug 🐛 Something is wrong and needs to be fixed need feedback ❓ Do not start working on it until a decision is reached

Comments

@differentreality
Copy link
Contributor

@ChrisBr as we discussed a couple of times we continue having this error:
http://paste.opensuse.org/83963228

It just occured over 4 times while creating a new proposal or registering for a conference.

It also seems to be a problem with other people:
ankane/ahoy#32

@gopesht
Copy link
Member

gopesht commented Jul 27, 2014

Yes it occurred with me, I thought I'll post thanks @differentreality for pointing it out.But @ChrisBr this error is weird in a sense that it occurs and on page refresh it is gone.Please look into in this in greater depth :)

@ChrisBr
Copy link
Member

ChrisBr commented Jul 29, 2014

@differentreality Ok, I can add the suggested debug option in a first step

@hennevogel
Copy link
Member

is this still an issue for anyone?

@differentreality
Copy link
Contributor Author

For me in development, ALL the time!

@hennevogel
Copy link
Member

@differentreality you are using sqlite or mysql?

@hennevogel
Copy link
Member

@ChrisBr
Copy link
Member

ChrisBr commented Dec 11, 2014

@hennevogel Do we know if this also happens in production?

@hennevogel
Copy link
Member

If you tell me which error it is I can look. @differentreality's paste isn't working anymore

@ChrisBr
Copy link
Member

ChrisBr commented Dec 15, 2014

@hennevogel

SQLite3::ConstraintException: PRIMARY KEY must be unique: INSERT INTO "ahoy_events" ("id", "name", "properties", "time", "user_id", "visit_id") VALUES (?, ?, ?, ?, ?, ?)

We should examine if this only happens with sqlite or also with MySQL/Production! If yes I would say we should definitely fix this for V1.0

@hennevogel
Copy link
Member

This also happens in production.

Mysql2::Error: Duplicate entry '99' for key 'PRIMARY': INSERT INTO `visits`

@ChrisBr
Copy link
Member

ChrisBr commented Dec 16, 2014

@hennevogel @differentreality Tried it on https://events.opensuse.org/ 10 times and no exception occurred! @hennevogel could you please look into db if events get logged?

@ChrisBr
Copy link
Member

ChrisBr commented Dec 17, 2014

Update:
Tried the fix suggested in
ankane/ahoy#32
but then the id column isn't a primary key anymore!
Added a comment with this information to the issue!

Now we have these two solutions:

  • We can wait till there is a fix
  • We can implement the suggested "hot fix", but this can cause that we have records without an primary key ...

@differentreality @hennevogel What do you think?

@differentreality
Copy link
Contributor Author

BTW I also get
SQLite3::ConstraintException: PRIMARY KEY must be unique: INSERT INTO "visits" ("browser", "country", "device_type", "id", "ip", "landing_page", "os", "started_at", "user_agent", "user_id", "visitor_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

ActiveRecord::StatementInvalid (SQLite3::ConstraintException: PRIMARY KEY must be unique: INSERT INTO "visits" ("browser", "country", "device_type", "id", "ip", "landing_page", "os", "started_at", "user_agent", "user_id", "visitor_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)):

@meonkeys
Copy link
Contributor

I'm seeing a bunch of errors like #379 (comment) in my log/production.log file for https://osem.seagl.org/ . For example:

Mysql2::Error: Duplicate entry '4' for key 'PRIMARY': INSERT INTO `visits` ...

(snipped). Also, for one other table:

Mysql2::Error: Duplicate entry '9' for key 'PRIMARY': INSERT INTO `ahoy_events` ...

(also snipped)

I'm running OSEM from 124d275

@differentreality
Copy link
Contributor Author

ankane/ahoy#32 is now closed and there are new versions of ahoy gem. Worth updating and re-checking if this issue is still valid?

@bear454
Copy link
Contributor

bear454 commented Mar 16, 2018

Ahoy is a performance train wreck. IMO the campaigns feature isn't worth the trouble, but even if it is, I'm confident it can be handled much more performantly without Ahoy. I'll extract my WIP changes out to a commit and link here. (I've removed Ahoy for LFNW branch).

@bear454
Copy link
Contributor

bear454 commented Oct 16, 2018

Closed with #2205.

@bear454 bear454 closed this as completed Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something is wrong and needs to be fixed need feedback ❓ Do not start working on it until a decision is reached
Projects
None yet
Development

No branches or pull requests

6 participants