[ZBX-11958] SQL Error adding new Value Mapping Created: 2017 Mar 22 Updated: 2024 Apr 10 Resolved: 2017 Mar 24 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 3.0.8 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Daniel Weber | Assignee: | Unassigned |
Resolution: | Won't fix | Votes: | 0 |
Labels: | error, sql, valuemapping | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Single Server Environment. |
Team: | Team C |
Sprint: | Sprint 4 |
Story Points: | 1 |
Description |
When trying to add a valuemapp from Frontend, it shows the Error: Seems like Zabbix doesn't check the latest number on the Table, f.e. with select MAX(valuemapid) FROM valuemaps; |
Comments |
Comment by richlv [ 2017 Mar 22 ] | ||||||
that looks like a corrupted database or an attempt to edit the db manually. | ||||||
Comment by Daniel Weber [ 2017 Mar 23 ] | ||||||
We haven't manipulated the DB. It was installed a year ago on a Centos 7 over yum. | ||||||
Comment by Gregory Chalenko [ 2017 Mar 23 ] | ||||||
Values for all key fields are stored in "ids" table, in Your case it will contain row:
| ||||||
Comment by Daniel Weber [ 2017 Mar 23 ] | ||||||
Hello Gregory Chalenko Thanks for your Reply, yes you're right, the field shows 25, is it save to update this filed manually as a workarround? So the question for the bug is, which process hasn't updated this field. Regards: | ||||||
Comment by Gregory Chalenko [ 2017 Mar 23 ] | ||||||
Increasing field value to 26 will work but it is not advisable to change Zabbix database manually. All database writes in Zabbix are wrapped in transactions and for this case it looks like transaction was completed partially. New row were added but ids table was not saved properly. | ||||||
Comment by Gregory Chalenko [ 2017 Mar 23 ] | ||||||
Can you please describe steps you did before get this kind of error? | ||||||
Comment by richlv [ 2017 Mar 23 ] | ||||||
you can also just remove that entry from the 'ids' table. of course, there is a chance that some bug in zabbix has left this problem in the db - but unless there is a repeatable scenario on how to do so, there does not seem to be an indication of a bug here. | ||||||
Comment by Daniel Weber [ 2017 Mar 23 ] | ||||||
I'm not really sure, we just try to Import a Template from share Zabbix and had to insert new Valuemaps. At the beginning of this installation, we have imported some of the Templates and Valuemaps from another Zabbix Installation. | ||||||
Comment by Daniel Weber [ 2017 Mar 23 ] | ||||||
@richlv Thanks, will we still be supportable? | ||||||
Comment by richlv [ 2017 Mar 23 ] | ||||||
well, if you don't have a support contract, it's all just somebody in the internet when you said "had to insert new Valuemaps", which methods did you use - as in, how exactly did you do that all those times ? | ||||||
Comment by Daniel Weber [ 2017 Mar 23 ] | ||||||
We used the normal way over the Frontend (Web). Yes we have a Support contract, i just wanted to be sure we're not doing something unsupported. | ||||||
Comment by Gregory Chalenko [ 2017 Mar 23 ] | ||||||
Deleting row will be bad choice. Much better just update field with something like: UPDATE ids SET nextid=nextid+1 WHERE table_name = "valuemaps" AND field_name = "valuemapid" | ||||||
Comment by Gregory Chalenko [ 2017 Mar 24 ] | ||||||
If you can reproduce this bug please open new issue and describe steps. | ||||||
Comment by richlv [ 2017 Mar 24 ] | ||||||
gcalenko, could you please expand a bit on why deleting that entry would be bad ? | ||||||
Comment by Gregory Chalenko [ 2017 Mar 24 ] | ||||||
Table data is used for every insert operation, deleting can cause another type of error. | ||||||
Comment by Daniel Weber [ 2017 Mar 24 ] | ||||||
Thanks for all the comments. | ||||||
Comment by richlv [ 2017 Mar 24 ] | ||||||
gcalenko, zabbix components tend to recalculate ids if missing - are there any known situation when this could cause problems ? |