solved AUDIO PRO - Gallery Creation Problem

serveion
@serveion
7 years ago
223 posts
Hello

every time i try to create a gallery this notice show up.

Unable to create the gallery images in the database - please try again.
updated by @serveion: 04/17/17 12:35:43AM
nate
@nate
7 years ago
917 posts
Have you run an integrity check?
serveion
@serveion
7 years ago
223 posts
hello @nate

yes I did run integrity check
Black-Eagle
Black-Eagle
@black-eagle
7 years ago
57 posts
Have you an error message in your activity log ?
serveion
@serveion
7 years ago
223 posts
hello @black-eagle

Activity
Query Error: Duplicate entry 'gallery_order-5-0' for key 'PRIMARY'

Debug

(2017-01-14T09:47:56-05:00.0.63545000 : 0)-(mem: 3.8MB)-(pid: 5693)-(ip: 000.0.00.0)-(user: jamroom)-(uri: POST /gallery/create_save/__ajax=1)
Array
(
    [error] => Query Error: Duplicate entry 'gallery_order-2-0' for key 'PRIMARY'
    [_post] => Array
        (
            [_uri] => /gallery/create_save/__ajax=1
            [jr_html_form_token] => 2ceab2590675d69d173188569c51584d
            [jr_html_form_profile_id] => 255
            [upload_token] => cb676b5a51406186644d6cae1e51795a
            [jroneall_share_to_networks] => off
            [jraction_add_to_timeline] => on
            [gallery_title] => General
            [rocketchatscreenshare] => chrome
            [__cfduid] => db7b9efd6aee1f41351ac8220ca6a23f21482333639
            [jrcore_pager_rows] => 100
            [roundcube_cookies] => enabled
            [_ga] => GA1.2.780432389.1482333651
            [auto16e973d3dbb5] => 1-42199fe90bf67b1132245d0038ddaa07
            [__unam] => 6d6cd6f-15951887563-7ee4d85c-218
            [sess16e973d3dbb5] => 81817e301e3f4e27270519ebae3ed655
            [jr_location_url] => https://domain.com/gallery/create
            [module_url] => gallery
            [module] => jrGallery
            [option] => create_save
            [__ajax] => 1
        )

    [query] => /* [domain]:/gallery/create_save/__ajax=1 */ INSERT INTO jr_jrgallery_item_key (`_item_id`,`_profile_id`,`key`,`index`,`value`) VALUES (2,255,'gallery_title','0','General'),(2,255,'gallery_title_url','0','general'),(2,255,'gallery_order','0','1'),(2,255,'_created','0',UNIX_TIMESTAMP()),(2,255,'_updated','0',UNIX_TIMESTAMP()),(2,255,'_profile_id','0','255'),(2,255,'_user_id','0','1'),(2,255,'gallery_pending','0','0')
)
michael
@michael
7 years ago
7,714 posts
That error is saying "The database is setup to only allow me to write unique things to it, but one already exists for what you're trying to create right now, sorry, try again".

It shouldnt happen.

Have you deleted the database for the gallery at all recently?

Try logging out and back in again.

Have you got steps to reproduce that issue?

It shouldnt be happening.
nate
@nate
7 years ago
917 posts
Sounds like a bug you get when you reinstall but don't truncate all the tables. I've done it myself.
michael
@michael
7 years ago
7,714 posts
With the query from your debug log, if i run that on my jamroom database, it works the first time, but if I run it AGAIN it fails with the same error you see.

This seams to point to the query being run TWICE for whatever reason. Can you think of any way that could be happening in your situation?
serveion
@serveion
7 years ago
223 posts
michael:
That error is saying "The database is setup to only allow me to write unique things to it, but one already exists for what you're trying to create right now, sorry, try again".

It shouldnt happen.

Have you deleted the database for the gallery at all recently?

Try logging out and back in again.

Have you got steps to reproduce that issue?

It shouldnt be happening.

hello
last thing i did update later image gallery module.

1. Created a profile
2. I uploaded some music videos from youtube.
3. i try to upload images to gallery.
4 i added name "general" i upload two images. and click upload then the error show up.

i haven't delete any image gallery module I update it
serveion
@serveion
7 years ago
223 posts
Hello

so i would have to uninstall image module and reinstall it?
michael
@michael
7 years ago
7,714 posts
reinstall shouldnt make any difference. will try to recreate this.
nate
@nate
7 years ago
917 posts
Is this a fresh install and brand new DB?
serveion
@serveion
7 years ago
223 posts
Hello @nate

Is not a fresh install i installed more then a year ago
nate
@nate
7 years ago
917 posts
OK I need to be clear on what's going on.

You have been running a jr site for a year?

If yes, are you just now installing the gallery module or have you been using it for a year?

Do you have any galleries on your site?

If you don't, which from the code it looks like maybe you have only one, truncate your gallery tables in the DB. There will be 2. Do you know how to do that?
updated by @nate: 01/14/17 04:46:41PM
serveion
@serveion
7 years ago
223 posts
nate:
OK I need to be clear on what's going on.

You have been running a jr site for a year?
yes for more than a year

If yes, are you just now installing the gallery module or have you been using it for a year?
no i installed that image gallery when i did the fresh install of the of jamroom

Do you have any galleries on your site?
yes i do have another gallery called "general" i dont know if the same name cause this

If you don't, which from the code it looks like maybe you have only one, truncate your gallery tables in the DB. There will be 2. Do you know how to do that?

yes i can post here how the tables looks like.

here is how it looks like when i dump the sql

--
-- Dumping data for table `jr_jrgallery_item`
--

INSERT INTO `jr_jrgallery_item` (`_item_id`) VALUES
(1),
(2),
(3),
(4),
(5),
(6),
(7),
(8);

-- --------------------------------------------------------

--
-- Table structure for table `jr_jrgallery_item_key`
--

CREATE TABLE IF NOT EXISTS `jr_jrgallery_item_key` (
  `_item_id` int(11) unsigned NOT NULL DEFAULT '0',
  `key` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `index` smallint(5) unsigned NOT NULL DEFAULT '0',
  `value` varchar(512) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `_profile_id` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`key`,`_item_id`,`index`),
  KEY `_item_id` (`_item_id`),
  KEY `value` (`value`(128)),
  KEY `_profile_id` (`_profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `jr_jrgallery_item_key`
--

INSERT INTO `jr_jrgallery_item_key` (`_item_id`, `key`, `index`, `value`, `_profile_id`) VALUES
(1, '_created', 0, '1454343515', 203),
(1, '_profile_id', 0, '203', 203),
(1, '_updated', 0, '1454583316', 203),
(2, '_updated', 0, '1465863303', 0),
(3, '_updated', 0, '1465863303', 0),
(4, '_updated', 0, '1465863303', 0),
(5, '_updated', 0, '1465863303', 0),
(6, '_updated', 0, '1465863303', 0),
(7, '_updated', 0, '1465863303', 0),
(8, '_updated', 0, '1465863303', 0),
(9, '_updated', 0, '1465863303', 0),
(10, '_updated', 0, '1465863303', 0),
(11, '_updated', 0, '1465863303', 0),
(12, '_updated', 0, '1465863303', 0),
(13, '_updated', 0, '1465863303', 0),
(14, '_updated', 0, '1465863303', 0),
(15, '_updated', 0, '1465863303', 0),
(16, '_updated', 0, '1465863303', 0),
(17, '_updated', 0, '1465863303', 0),
(18, '_updated', 0, '1465863303', 0),
(19, '_updated', 0, '1465863303', 0),
(20, '_updated', 0, '1465863303', 0),
(21, '_updated', 0, '1465863303', 0),
(22, '_updated', 0, '1465863303', 0),
(23, '_updated', 0, '1465863303', 0),
(24, '_updated', 0, '1465863303', 0),
(25, '_updated', 0, '1465863303', 0),
(26, '_updated', 0, '1465863303', 0),
(28, '_updated', 0, '1465863303', 0),
(29, '_updated', 0, '1465863303', 0),
(1, '_user_id', 0, '1', 203),
(1, 'gallery_image_extension', 0, 'jpg', 203),
(1, 'gallery_image_height', 0, '590', 203),
(1, 'gallery_image_name', 0, 'alex-bueno-2015.jpg', 203),
(1, 'gallery_image_size', 0, '26705', 203),
(1, 'gallery_image_time', 0, '1454343515', 203),
(1, 'gallery_image_type', 0, 'image/jpeg', 203),
(1, 'gallery_image_view_count', 0, '46', 203),
(2, 'gallery_image_view_count', 0, '29', 0),
(3, 'gallery_image_view_count', 0, '35', 0),
(4, 'gallery_image_view_count', 0, '31', 0),
(5, 'gallery_image_view_count', 0, '30', 0),
(6, 'gallery_image_view_count', 0, '32', 0),
(7, 'gallery_image_view_count', 0, '5', 0),
(8, 'gallery_image_view_count', 0, '8', 0),
(9, 'gallery_image_view_count', 0, '12', 0),
(10, 'gallery_image_view_count', 0, '28', 0),
(11, 'gallery_image_view_count', 0, '29', 0),
(12, 'gallery_image_view_count', 0, '26', 0),
(13, 'gallery_image_view_count', 0, '27', 0),
(14, 'gallery_image_view_count', 0, '23', 0),
(15, 'gallery_image_view_count', 0, '10', 0),
(16, 'gallery_image_view_count', 0, '5', 0),
(17, 'gallery_image_view_count', 0, '5', 0),
(18, 'gallery_image_view_count', 0, '5', 0),
(19, 'gallery_image_view_count', 0, '6', 0),
(20, 'gallery_image_view_count', 0, '8', 0),
(21, 'gallery_image_view_count', 0, '6', 0),
(22, 'gallery_image_view_count', 0, '9', 0),
(23, 'gallery_image_view_count', 0, '6', 0),
(24, 'gallery_image_view_count', 0, '6', 0),
(25, 'gallery_image_view_count', 0, '6', 0),
(26, 'gallery_image_view_count', 0, '4', 0),
(28, 'gallery_image_view_count', 0, '2', 0),
(29, 'gallery_image_view_count', 0, '1', 0),
(1, 'gallery_image_width', 0, '800', 203),
(1, 'gallery_order', 0, '1', 203),
(2, 'gallery_order', 0, '100', 0),
(3, 'gallery_order', 0, '100', 0),
(4, 'gallery_order', 0, '100', 0),
(5, 'gallery_order', 0, '100', 0),
(6, 'gallery_order', 0, '100', 0),
(7, 'gallery_order', 0, '100', 0),
(8, 'gallery_order', 0, '100', 0),
(9, 'gallery_order', 0, '100', 0),
(10, 'gallery_order', 0, '100', 0),
(11, 'gallery_order', 0, '100', 0),
(12, 'gallery_order', 0, '100', 0),
(13, 'gallery_order', 0, '100', 0),
(14, 'gallery_order', 0, '100', 0),
(15, 'gallery_order', 0, '100', 0),
(16, 'gallery_order', 0, '100', 0),
(17, 'gallery_order', 0, '100', 0),
(18, 'gallery_order', 0, '100', 0),
(19, 'gallery_order', 0, '100', 0),
(20, 'gallery_order', 0, '100', 0),
(21, 'gallery_order', 0, '100', 0),
(22, 'gallery_order', 0, '100', 0),
(23, 'gallery_order', 0, '100', 0),
(24, 'gallery_order', 0, '100', 0),
(25, 'gallery_order', 0, '100', 0),
(26, 'gallery_order', 0, '100', 0),
(28, 'gallery_order', 0, '100', 0),
(29, 'gallery_order', 0, '100', 0),
(1, 'gallery_short_url', 0, 't5Ys2AiG', 203),
(1, 'gallery_title', 0, 'General', 203),
(1, 'gallery_title_url', 0, 'general', 203);

serveion
@serveion
7 years ago
223 posts
hello
what i did was delete module and delete database for that module and reinstall everything is working ok now.
michael
@michael
7 years ago
7,714 posts
good to hear that you've found a solution, sorry we couldnt pin point the cause to have you avoid that step.

Hope rebuilding the galleries isnt too much of a hassle.
serveion
@serveion
7 years ago
223 posts
Hello

Well now i know what to do with my free time lol
Thank you so much.

Tags