Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pwg.images.addSimple fails when supplying tags #2082

Open
phako opened this issue Jan 1, 2024 · 7 comments
Open

pwg.images.addSimple fails when supplying tags #2082

phako opened this issue Jan 1, 2024 · 7 comments

Comments

@phako
Copy link

phako commented Jan 1, 2024

I have a weird issue where a call to pwg.images.addSimple fails when the image in question is added with the tags parameter present.

Piwigo is 14.1.0
Apache2 2.4.57-2
php 8.2

on Debian Bookworm.

I am pretty sure this used to work, but since I upgraded Piwigo and PHP I cannot tell you which of the two might have broken it.
There is of course also a small chance that I am doing something weird in Shotwell's upload code.

Failure mode is either a 501 Missing "method" name if the tags are hierarchical (eg. "/foo/bar/baz") or a 401 Access denied if its just plain tags.

Working form data:

> Host: jensge.org
> 
> --588d05a9fcd087d51198ec360f1ba1b725c79def406bf6a2e745877851d0b96f
> Content-Disposition: form-data; name="name"
> 
> DCIM_00001_1.png
> --588d05a9fcd087d51198ec360f1ba1b725c79def406bf6a2e745877851d0b96f
> Content-Disposition: form-data; name="method"
> 
> pwg.images.addSimple
> --588d05a9fcd087d51198ec360f1ba1b725c79def406bf6a2e745877851d0b96f
> Content-Disposition: form-data; name="category"
> 
> 6
> --588d05a9fcd087d51198ec360f1ba1b725c79def406bf6a2e745877851d0b96f
> Content-Disposition: form-data; name="level"
> 
> 8
> --588d05a9fcd087d51198ec360f1ba1b725c79def406bf6a2e745877851d0b96f
> Content-Type: image/jpeg
> Content-Disposition: form-data; filename=DCIM_00001_1.png.jpg; name=image
> 
> ����

Non-working form data, resulting in "401 Access denied" error:

> Host: jensge.org
> 
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="name"
> 
> IMG_0059.JPG
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="method"
> 
> pwg.images.addSimple
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="category"
> 
> 6
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="level"
> 
> 8
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="tags"
> 
> Hamburg,Wandern
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Type: image/jpeg
> Content-Disposition: form-data; filename=IMG_0059.JPG; name=image
> 
> ����
  
@phako
Copy link
Author

phako commented Jan 1, 2024

Form data resulting in Missing "method" name

> Host: jensge.org
> 
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="name"
> 
> IMG_0059.JPG
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="method"
> 
> pwg.images.addSimple
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="category"
> 
> 6
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="level"
> 
> 8
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Disposition: form-data; name="tags"
> 
> /Hamburg,/Hamburg/Sport,/Hamburg/Sport/Wandern
> --cc6dd8138b0a340f9f29a319659f3fac31ef95b4301f83b39253b76fb254d8d2
> Content-Type: image/jpeg
> Content-Disposition: form-data; filename=IMG_0059.JPG; name=image
> 
> ����

@phako
Copy link
Author

phako commented Jan 3, 2024

Its a bit weirder. If the first thing you upload has the second post format, only then another post with "normal tags" included will fail - even if it worked before

@phako
Copy link
Author

phako commented Jan 3, 2024

Ok, this is probably not a bug but a config issue, trying to upload files that exceed upload_max_filesize/post_max_size - a nicer error message would be helpful, though

@xpseudonym
Copy link

Doesn't this:
#1720 (comment)
Appear to have resolved the max_filesize issue?

@xpseudonym
Copy link

Ok, this is probably not a bug but a config issue, trying to upload files that exceed upload_max_filesize/post_max_size - a nicer error message would be helpful, though

So, this is not a tags problem at all?

@phako
Copy link
Author

phako commented Jan 24, 2024

Maybe. But there is definitely different behavior depending on the type of tag there, which is also weird

@plegall
Copy link
Member

plegall commented Jan 24, 2024

I'm testing with nginx instead of apache but on Debian 12 as well. It works fine but I indeed have to adjust /etc/php/8.2/fpm/php.ini to increase values for post_max_size and upload_max_filesize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants