Piwigo Import Tree Errors #607

Closed
opened 2026-10-05 00:07:00 +02:00 by adam · 3 comments
Owner

Hi the above tool doesnt seem to work
I keep getting error:

malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<br />\n<b>Warning</...") at /usr/share/perl5/JSON.pm line 171.

The picture uploads fine but then stops everything else uploading correctly

Should this have some error checking or warning feature????

my $response = $ua->post(
     $conf{base_url}.'/ws.php?format=json',
     {
         method => 'pwg.categories.getImages',
         cat_id => $params{album_id},
         per_page => 1000000,
     }
 );

 foreach my $image_href (@{from_json($response->content)->{result}{
+images}}) {
     $photos_of_album{ $params{album_id} }{ $image_href->{file} } =
+ $image_href->{id};

Hi the above tool doesnt seem to work I keep getting error: `malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<br />\n<b>Warning</...") at /usr/share/perl5/JSON.pm line 171.` The picture uploads fine but then stops everything else uploading correctly Should this have some error checking or warning feature???? ``` my $response = $ua->post( $conf{base_url}.'/ws.php?format=json', { method => 'pwg.categories.getImages', cat_id => $params{album_id}, per_page => 1000000, } ); foreach my $image_href (@{from_json($response->content)->{result}{ +images}}) { $photos_of_album{ $params{album_id} }{ $image_href->{file} } = + $image_href->{id}; ``` <!-- github-sync-id:224788955 -->
adam closed this issue 2026-10-05 00:07:00 +02:00
Author
Owner

Well its looks like the new version of Piwigo has fixed this issue for me now - just updated to the new version 2.9.0 and the script seems to be running without error at the moment so this can be closed now! Yay

Well its looks like the new version of Piwigo has fixed this issue for me now - just updated to the new version 2.9.0 and the script seems to be running without error at the moment so this can be closed now! Yay <!-- github-comment-id:298619344 -->
Author
Owner

I'm trying to migrate from DAlbum to Piwigo and am currently having this issue with v2.9.1 on 3 different directories. After about 18 photos uploaded, I get this error:

malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "
\nWarning</...") at /home/jsv/piwigo_import_tree.pl line 366.

I was able to upload a few hundred already but still have about 25,000 photos to move over. This program would be great if I can work through the issues.

P.S. The --parent_album_id option doesn't seem to be working either.

Please let me know what information I can provide.

Thanks,

-Jeff

I'm trying to migrate from DAlbum to Piwigo and am currently having this issue with v2.9.1 on 3 different directories. After about 18 photos uploaded, I get this error: malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<br />\n<b>Warning</...") at /home/jsv/piwigo_import_tree.pl line 366. I was able to upload a few hundred already but still have about 25,000 photos to move over. This program would be great if I can work through the issues. P.S. The --parent_album_id option doesn't seem to be working either. Please let me know what information I can provide. Thanks, -Jeff <!-- github-comment-id:329310999 -->
Author
Owner

I forgot some other important parts. I'm running Piwigo 2.9.1 on CentOS 7.4 with the stock Apache 2.4.6 and I'm using v1.0 of piwigo_import_tree.pl.

-Jeff

I forgot some other important parts. I'm running Piwigo 2.9.1 on CentOS 7.4 with the stock Apache 2.4.6 and I'm using v1.0 of piwigo_import_tree.pl. -Jeff <!-- github-comment-id:329311741 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#607