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
API returned an error (primary keys missing in database) #7830
Comments
This is problematic. The value should exist only once at all times. I can see there was a change recently If we do create a new sequence there, it should check for a specific exception, not just for any exception. @msigrun Can you execute the following SQL query and post the output here? |
It is MySQL 5 CREATE TABLE |
But this is strange: I am using Piwik also on a different server (same provider, also MySQL 5). There, Piwik 2.12.1 worked and I just succeeded with the update to 2.13. Here is the SQL result: In the dumpfile of the elder database version it looks like this (from Piwik 2.12.1): How come that my other installation has PRIMARY KEY defined in table myprefix_sequence? I tried this SQL-statement (with PRIMARY KEY) to solve the problem: Now, the data re-appeared. Fine. |
I expected that for some random reason there's no primary key defined in your sequence table. There should a primary key defined (as you already figured out and added one). I have no clue how this can happen. Maybe someone else can? Do you use MySQL 5.0 or a later one? The dashboard problem seems to be unrelated to this. At least I cannot explain how this could happen because of this. Is there maybe a primary key missing as well? Can you execute the query |
MySQL-Server is 5.5.41-0+wheezy1 whereas the other installation (which works) has True. This table has no primary key and I am afraid more tables are affected. How come? Should I contact my provider as both installations are a provided service (1st click installation)? |
It would be great if you could contact your provider. Maybe they have heard of something like this before. It's the first time that I see such an issue. I have no clue how this can happen and didn't find anything when searching for it. Maybe someone else has an idea? |
Thank you tsteur for your help. I will contact the provider and keep you informed. Someone else has an idea? As this bug also existed somewhere else like in the forum I mentioned above. |
I think the problem for the users in the forum was fixed. It was caused for them by a different problem. |
The provider recommends a new installation. I will do this and then insert the existing data. |
Thx for letting us know. I will close it for now. If anyone has an idea how this can happen, or whether it happened before (in this case we could maybe add a system check for this or a self-repair) please comment here. |
@msigrun just a question, do you have another application installed in the same database? |
No other application, I started with a new database. I found the source of trouble when I did the new installation. In the beginning, the primary key was missing again, because I copied the original tables with a new prefix (phpMyAdmin 4.0.5). If I do so, the copied table has no primary key! I tried this several times, every time it was like this. Just as I finally replaced the prefix piwik_ with myprefix_, the primary key stayed. |
OK thx! |
Hi,
in the forum http://forum.piwik.org/read.php?2,122923 you said this bug should be fixed but unfortunately, it is not in my Piwik installation version 2.12.1.
I get this error message:
API returned an error: Sequence 'myprefix_archive_numeric_2015_05' not found. at Sequence.php:99
'INSERT INTO myprefix_sequence (name, value) VALUES ('myprefix_archive_numeric_2015_03' , 99999)' did not fix the problem. In the database table 'myprefix_sequence' I find the name
'myprefix_archive_numeric_2015_05' 113 times (with the values 1 until 222 and the value 100047 between 47 and 49) while the other names like 'myprefix_archive_numeric_2015_04' exist only one time.
Indeed, the number of 'myprefix_archive_numeric_2015_05'-names in the table myprefix_sequence increases every time I refresh the piwik-webpage, right now it took154 rows in the table.
Then I deleted all the lines containing 'myprefix_archive_numeric_2015_05' and used the SQL above. It worked one time when I refreshed the piwik page, then the number of entrys in the table 'myprefix_sequence' increased again.
If you need more information please tell me. I would be grateful for your help.
The text was updated successfully, but these errors were encountered: