Jump to content
  • 0

Installing Module Oh Noes! Sqlstate[23000]: Integrity Constraint Violation: 1062 Duplicate Entry


Blesta Addons

Question

HEllo

when i want to install my own new module i get the fallowing error

Oh noes!

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '22-' for key 'PRIMARY' on line 124 in /home/xxxxxx/public_html/blesta/lib/model.php

Printing Stack Trace:

#0 /home/vpsmaroc/public_html/blesta/lib/model.php(124): PDOStatement->execute(Array)

#1 /home/vpsmaroc/public_html/blesta/components/record/record.php(225): Model->query('INSERT INTO `mo...', Array)

#2 /home/vpsmaroc/public_html/blesta/app/models/module_manager.php(401): Record->insert('module_meta', Array, Array)

#3 /home/vpsmaroc/public_html/blesta/app/controllers/admin_company_modules.php(75): ModuleManager->setMeta('22', Array)

#4 /home/vpsmaroc/public_html/blesta/lib/dispatcher.php(111): AdminCompanyModules->manage()

#5 /home/vpsmaroc/public_html/blesta/index.php(21): Dispatcher::dispatch('/blesta/admin/s...')

#6 {main}

any idea in this ?

i'm using blesta 3.4.3 , new upgraded .

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

sounds like the module row is in the database already.

no ; i have deleted all the rows, and i get the same error .

it seem like it add it twice in installation process !!!

the table name related here is "module_meta" , the content of the dabatabse is .

 

module_id  key value serialized encrypted
22              N;   1          0

note i can install other modules , this is just for this custom module, i knows this can be related tomy module, but it have the same class as i use always .

Link to comment
Share on other sites

  • 0

other, even if you removed the row in DB, it's look like the previous ID can be still re-used at next insert? 

 

or new entry will be inserted using the next ID?

 

Normaly I think it should be second case, but you could double check in real for you.

 

 

Not certain about it but it's like if the module id is not really a primary key, you could double check that

Link to comment
Share on other sites

  • 0

other, even if you removed the row in DB, it's look like the previous ID can be still re-used at next insert? 

 

or new entry will be inserted using the next ID?

 

Normaly I think it should be second case, but you could double check in real for you.

 

 

Not certain about it but it's like if the module id is not really a primary key, you could double check that

is not a double click . and is not related to databse .

other modules installed without any probleme , i have removed all the function in my class , i let just the manage module classes .

is very strange , is not my first module, if i remember well ihave done more than 20 modules , and the same logic, classes !!!

i will try to debug more , but if blesta staff has a road to save me some hours of search/test is better .

Link to comment
Share on other sites

  • 0

it seem like it add it twice in installation process !!!

the table name related here is "module_meta" , the content of the dabatabse is .

 

module_id  key value serialized encrypted
22              N;   1          0

 

Can you provide the meta data you are using (which is being inserted as duplicate)? What is the value of each `key`? It sounds like you may be adding multiple meta records for the module, and some may have the same key, which causes a duplicate key entry error. Both the `module_id` and the `key` make up the primary key, so each `key` must be unique for the same module.

Link to comment
Share on other sites

  • 0

The meta data is added during a POST request from the manage page of the module. You would need to check the POST data being submitted from that page.

i have back today to this project . the manage page , you referrer to the manage.pdt ? i don't send any request .

i will begin from the scratch again .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...