From the cpanel you have access to you database with phpmyadmin. Use it to check the prefixes
Offline
I'm getting the same error during my import...I noticed the item image01 seems to by where yours fails and mine on year1 -- I wonder if the import has issues with numbers and letters in that field?
mike15 wrote:
Hi,
I've been following the steps outlined in the Menalto2Piwigo plugin. Upon executing the last Import step, it results in the following page with a bunch of warnings and errors. Could someone take a look and let me know if you need anything else?Notice: Undefined variable: piwig_id in /var/www/mysite.com/htdocs/piwigo/plugins/menalto2piwigo/admin.php on line 195
Error, is not an image and Menalto says it is an image
Notice: Undefined variable: piwig_id in /var/www/mysite.com/htdocs/piwigo/plugins/menalto2piwigo/admin.php on line 195
Error, is not an image and Menalto says it is an image
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='Image01'' at line 16
SELECT
f.g_id,
i.g_title,
i.g_summary,
i.g_description,
i.g_canContainChildren,
a.g_orderWeight,
a.g_viewCount,
FROM_UNIXTIME(e.g_creationTimestamp)
FROM g2_Item i
JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
JOIN g2_ChildEntity c ON f.g_id = c.g_id
JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
JOIN g2_Entity e ON e.g_id = i.g_id
WHERE c.g_parentId =
AND f.g_pathComponent='Image01'
; in /var/www/mysite.com/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php on line 798
Fatal error: Call to a member function fetch_row() on a non-object in /var/www/mysite.com/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php on line 186
Warning: [mysql error 1146] Table 'g2-to-g3.piwigo_sessions' doesn't exist
REPLACE INTO piwigo_sessions
(id,data,expiration)
VALUES('AC05de2lb0q7663npo3i18vl33jjr0','pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;pwg_uid|i:1;need_update|b:0;extensions_need_update|a:0:{}',now())
; in /var/www/mysite.com/htdocs/piwigo/include/dblayer/functions_mysqli.inc.php on line 798
I am having the same issue. The problem is related to the SQL query and the value for parentID is empty.
SELECT
f.g_id,
i.g_title,
i.g_summary,
i.g_description,
i.g_canContainChildren,
a.g_orderWeight,
a.g_viewCount,
FROM_UNIXTIME(e.g_creationTimestamp)
FROM g2_Item i
JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
JOIN g2_ChildEntity c ON f.g_id = c.g_id
JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
JOIN g2_Entity e ON e.g_id = i.g_id
WHERE c.g_parentId =
AND f.g_pathComponent='DSCN1375.JPG'
So the SQL statement is not able to execute.
in the admin.php script on line 179 I've added ticks around ".$parentId."
WHERE c.".$pc."parentId = '".$parentId."'
This seems to have done the trick although I'll have to do a reload of the application and try again from scratch to be sure.
Offline
Hello,
I'm trying (hard) to migrate a G2 gallery into a very fresh Piwigo one.
I successfully followed every recommended step, but I was hit by the bug mentioned above : so in the faulty SQL query, I added the quotes around the parentId variable.
- 1 - I feel this is not the better way to fix the bug, there must be something missing before this query is launched
- 2 - When adding these quotes (on line 180 : WHERE c.".$pc."parentId = ".$parentId."), the first bug disappear but leads to a huge page of so many errors I think things are still worse.
I use to be a coder, but these days are long gone. I'm not sure I could debug this by myself.
I'll be glad to help to test any patch on my own servers and datas.
Is this thread the right place to speak about it?
I understood PLG ported the Perl code into PHP. Should I speak to PLG or dschwen to debug that?
Should I try the perl version before debugging the PHP version?
Thank you.
--
Nec
Offline
Thanks for this pointer (that I was pointed to from my question on the same topic).
As I look farther down the code, I wonder if the following also need quotes:
Line 281:
WHERE c.".$pc."parentId = ".$ids[$level];
Also, after making this change, I got the following errors:
I got this one about 50 times (for ~20k images):
Notice: Undefined variable: piwig_id in /var/www/piwigo/plugins/menalto2piwigo/admin.php on line 207
Error, is not an image and Menalto says it is an image
I got this one about 100 times (with the offset changing):
Notice: Undefined offset: 8687 in /var/www/piwigo/plugins/menalto2piwigo/admin.php on line 295
And then I got this one at the end (it was unclear from this error if the import was successful):
Warning: [mysql error 1062] Duplicate entry '273' for key 'the_key'
INSERT INTO piwigo_images_1416224622509102
(id,name,comment,date_available)
VALUES('1','IMG_5306.JPG',NULL,'2013-01-08 06:30:29')
, ('2','IMG_5307.JPG',NULL,'2013-01-08 06:30:30')
, ('3','IMG_5308.JPG',NULL,'2013-01-08 06:30:30')
, ('4','IMG_5309.JPG',NULL,'2013-01-08 06:30:30')
, ('5','IMG_5310.JPG',NULL,'2013-01-08 06:30:30')
, ('6','IMG_5311.JPG',NULL,'2013-01-08 06:30:30')
, ('7','IMG_5312.JPG',NULL,'2013-01-08 06:30:30')
, ('8','IMG_5313.JPG',NULL,'2013-01-08 06:30:30')
, ('9','IMG_5314.JPG',NULL,'2013-01-08 06:30:31')
, ('10','IMG_5315.JPG',NULL,'2013-01-08 06:30:31')
, ('11','IMG_5316.JPG',NULL,'2013-01-08 06:30:31')
, ('12','IMG_5317.JPG',NULL,'2013-01-08 06:30:31')
, ('13','IMG_5318.JPG',NULL,'2013-01-08 06:30:31')
, ('14','IMG_5319.JPG',NULL,'2013-01-08 06:30:31')
, ('15','IMG_5320.JPG',NULL,'2013-01-08 06:30:31')
, ('16','IMG_5321.JPG',NULL,'2013-01-08 06:30:31')
, ('17','IMG_5322.JPG',NULL,'2013-01-08 in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830
Any suggestions on these?
Thank you,
Bill
Last edited by wsloand (2014-11-17 12:50:19)
Offline
Hi there,
I filled a bug to help us help the core team, providing them traces and test their patches :
http://piwigo.org/bugs/view.php?id=3177
--
NEC
Offline
Hi nec,
I will work on it. I have already modified the plugin 2 days ago after a big conversion of a Gallery3 into Piwigo.
Offline
Great!
For patch & tests, count me in.
Offline
I think I've made a mistake when converting the Perl script (from dschwen) to PHP.
In the Perl script we had:
$dir = $_; @path = split(/\//); $level = int(@path); next if( $level == 0 ); $parentId = $ids[$level-1];
And I wrote in PHP:
$path = explode('/', $dir); $basename = $path[count($path)-1]; $level = count($path); $parentId = $ids[$level-1];
The problem is that I didn't take into account that $level could be 0. I suppose that this is the problem some people encountered because then $parentId is null and it breaks the SQL query. Adding quotes around $parentId in the SQL query is not the solution, because $parentId is not supposed to be null.
I wonder in which cases the $level can be 0. nec, I would like to be able to test with your data. I'm going to send you a private email about that.
By the way, the Undefined variable: piwig_id... is just because I made a typo, there is a missing "o" in the variable name, but this message Error, xxx is not an image and Menalto says it is an image should never occur, so I wonder what can cause it.
Offline
The plugin is on Github https://github.com/plegall/menalto2piwigo if anybody wants to create pull-requests...
Offline
Hi Plg,
tested latest change, the Undefined variable: piwig_id are gone, rest ist still the same.
Error, c8 is not an image and Menalto says it is an image
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.kkb_g_pathComponent='IMG_0479.jpg'' at line 16
SELECT
f.kkb_g_id,
i.kkb_g_title,
i.kkb_g_summary,
i.kkb_g_description,
i.kkb_g_canContainChildren,
a.kkb_g_orderWeight,
a.kkb_g_viewCount,
FROM_UNIXTIME(e.kkb_g_creationTimestamp)
FROM kkb_g2_Item i
JOIN kkb_g2_FileSystemEntity f ON i.kkb_g_id = f.kkb_g_id
JOIN kkb_g2_ChildEntity c ON f.kkb_g_id = c.kkb_g_id
JOIN kkb_g2_ItemAttributesMap a ON i.kkb_g_id = a.kkb_g_itemId
JOIN kkb_g2_Entity e ON e.kkb_g_id = i.kkb_g_id
WHERE c.kkb_g_parentId =
AND f.kkb_g_pathComponent='IMG_0479.jpg'
; in /<path to Webspace>/piwigo/include/dblayer/functions_mysqli.inc.php on line 830
Fatal error: Call to a member function fetch_row() on a non-object in /<path to Webspace>/piwigo/include/dblayer/functions_mysqli.inc.php on line 216
When I add again the ticks in line 180 the rest stay the same.
Error, c8 is not an image and Menalto says it is an imageError, c9 is not an image and Menalto says it is an imageError, c12 is not an image and Menalto says it is an imageError, c3 is not an image and Menalto says it is an imageError, c5 is not an image and Menalto says it is an image
Notice: Undefined index: 371 in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined index: 4088 in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 295
Notice: Undefined index: 5365 in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 295
Warning: [mysql error 1062] Duplicate entry '8' for key 'the_key'
INSERT INTO kkb_piwigo_images_1416472357577612
(id,name,comment,date_available)
VALUES('8','Fruehschoppen',NULL,NULL)
, ('1','IMG_0479.jpg',NULL,NULL)
, ('2','IMG_0480.jpg',NULL,NULL)
, ('3','IMG_0481.jpg',NULL,NULL)
, ('4','IMG_0482.jpg',NULL,NULL)
, ('5','IMG_0483.jpg',NULL,NULL)
, ('6','IMG_0487.jpg',NULL,NULL)
, ('7','IMG_0489.jpg',NULL,NULL)
, ('8','IMG_0491.jpg',NULL,NULL)
, ('9','IMG_0492.jpg',NULL,NULL)
, ('10','IMG_0494.jpg',NULL,NULL)
, ('11','IMG_0495.jpg',NULL,NULL)
, ('12','IMG_0496.jpg',NULL,NULL)
, ('13','IMG_0497.jpg',NULL,NULL)
, ('14','IMG_0499.jpg',NULL,NULL)
, ('15','IMG_0500.jpg',NULL,NULL)
, ('16','IMG_0503.jpg',NULL,NULL)
, ('17','IMG_0506.jpg',NULL,NULL)
, ('18','IMG_9179_DxO.jpg',NULL,NULL)
, ('19','IMG_9180_DxO.jpg',NULL,NULL)
, ('20','IMG_9181_DxO.jpg',NULL,NULL)
, ('21','IMG_9182_DxO.jpg',NULL,NULL)
, ('22','IMG_9183_DxO.jpg',NULL,NULL)
, ('23','IMG_9187_DxO.jpg',NULL,NULL)
in /<path to Webspace>/piwigo/include/dblayer/functions_mysqli.inc.php on line 830
Notice: Undefined variable: comment_inserts in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 371
Warning: array_keys() [function.array-keys]: The first argument should be an array in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 371
Notice: Undefined variable: comment_inserts in /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php on line 373
Warning: Cannot modify header information - headers already sent by (output started at /<path to Webspace>/piwigo/plugins/menalto2piwigo/admin.php:207) in /<path to Webspace>/piwigo/include/page_header.php on line 101
---
ElBundy
Offline
OK, I think I fixed the bug :-) [Github] menalto2piwigo commit 2a59bb21
If you can test this little change nec, it will tell us if I'm right. I've checked on ElBundy and it fixed the problem.
Offline
I just tested it (copied admin.php from github into the plugin directory), and I got the following error:
Error, c273 is not an image and Menalto says it is an image
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND f.g_pathComponent='IMG_2274.CR2'' at line 16
SELECT
f.g_id,
i.g_title,
i.g_summary,
i.g_description,
i.g_canContainChildren,
a.g_orderWeight,
a.g_viewCount,
FROM_UNIXTIME(e.g_creationTimestamp)
FROM g2_Item i
JOIN g2_FileSystemEntity f ON i.g_id = f.g_id
JOIN g2_ChildEntity c ON f.g_id = c.g_id
JOIN g2_ItemAttributesMap a ON i.g_id = a.g_itemId
JOIN g2_Entity e ON e.g_id = i.g_id
WHERE c.g_parentId =
AND f.g_pathComponent='IMG_2274.CR2'
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830
Fatal error: Call to a member function fetch_row() on a non-object in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 216
Warning: [mysql error 1146] Table 'gallery2.piwigo_sessions' doesn't exist
REPLACE INTO piwigo_sessions
(id,data,expiration)
VALUES('[removed]','pwg_uid|i:1;pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;need_update|b:0;extensions_need_update|a:0:{}bulk_manager_filter|a:1:{s:9:\"prefilter\";s:11:\"last_import\";}incompatible_plugins|a:1:{s:10:\"~~expire~~\";i:1416187668;}pwg_referer_image_id|s:4:\"3784\";pwg_picture_deriv|s:6:\"xlarge\";',now())
; in /var/www/piwigo/include/dblayer/functions_mysqli.inc.php on line 830
Offline
plg wrote:
OK, I think I fixed the bug :-) [Github] menalto2piwigo commit 2a59bb21
If you can test this little change nec, it will tell us if I'm right. I've checked on ElBundy and it fixed the problem.
I just copied the last admin.php from github (so implied, the recent other fix), ran it and boom, other issues :
- Tons of
"Notice: Undefined offset: 8762 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 5041 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 21794 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 5039 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 5054 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 4657 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295 Notice: Undefined offset: 4705 in /home/sites/lvv-pw-ssl/plugins/menalto2piwigo/admin.php on line 295..."
- Then :
Warning: [mysql error 1146] Table 'gal2.g2_Comment' doesn't exist
SELECT
c.g_parentId AS id,
t.g_subject AS subject,
t.g_comment AS comment,
t.g_author AS author,
FROM_UNIXTIME(t.g_date) AS date
FROM g2_ChildEntity c
JOIN g2_Comment t ON t.g_id = c.g_id
WHERE t.g_publishStatus=0
in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 830
Fatal error: Call to a member function fetch_assoc() on a non-object in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 211
Warning: [mysql error 1146] Table 'gal2.sessions' doesn't exist
REPLACE INTO sessions
(id,data,expiration)
VALUES('50765casr5ueau7cj91aemlt5nr4j7','pwg_device|s:7:\"desktop\";pwg_mobile_theme|b:0;pwg_show_metadata|b:1;pwg_uid|i:1;pwg_multiview|a:8:{s:7:\"view_as\";s:1:\"1\";s:5:\"theme\";s:19:\"stripped_black_bloc\";s:4:\"lang\";s:5:\"fr_FR\";s:12:\"show_queries\";b:0;s:10:\"debug_l10n\";b:0;s:14:\"debug_template\";b:0;s:22:\"template_combine_files\";b:1;s:10:\"no_history\";b:0;}need_update|b:0;extensions_need_update|a:0:{}',now())
; in /home/sites/lvv-pw-ssl/include/dblayer/functions_mysqli.inc.php on line 830
Offline