Announcement

#1 2017-01-03 00:25:38

troffasky
Member
2015-06-13
13

Further logging for ws.php

Hello/Hi/Greetings,

Trying to troubleshoot an issue with uploading from Shotwell ["forbidden file type"] and I am hitting a wall, so want to turn up logging. This is what I have in local/config/config.inc.php:

$conf['ws_enable_log'] = true;
$conf['ws_log_filepath'] = '/var/www/gallery4/ws_log.log';
$conf['enable_i_log'] = true;
$conf['show_php_errors'] = E_ALL;
$conf['log_level'] = 'DEBUG';

ws_log.log is writable by Apache, but it remains empty.
_data/logs/log_<today>.txt is created when I upload a photo through the web interface. I can see [DEBUG] events when I then view that image and it gets resized. It doesn't ever log anything about ws.php when using Shotwell to upload to it.
Shotwell is able to create a new category but cannot upload any images.

I had a similar issue a few months ago which was due to PHP file size limits: http://piwigo.org/forum/viewtopic.php?id=26563 but I have tested with a 50kB JPEG and it still doesn't work [max upload is 64MB].

According to Apache logs, POST /gallery4/ws.php always gives a 200/OK. Apache error log is silent. What can I do to get ws.php to log something, anything at all?


Piwigo version: Piwigo 2.8.5
PHP version: PHP: 5.6.26-1
MySQL version:  5.7.16-1
Piwigo URL: http://ale.cx/gallery4

Offline

 

#2 2017-01-03 09:21:59

eliz82
Member
Romania
2016-04-27
191

Re: Further logging for ws.php

troffasky wrote:

$conf['ws_enable_log'] = true;
$conf['ws_log_filepath'] = '/var/www/gallery4/ws_log.log';
$conf['enable_i_log'] = true;

where did you find this config specifications?
i have just checked my "/include/config_default.inc.php" and I did not found those config specifications.

Offline

 

#3 2017-01-03 10:39:36

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

I almost certainly found them from googling. You won't find them in your config_default.inc.php as they're not defaults.

enable_i_log:

http://piwigo.org/doc/doku.php?id=user_ … es_missing

ws_enable_log:

Looks like this vanished between 2.7.4 and 2.8:

https://fossies.org/diffs/piwigo/2.7.4_ … -diff.html

so no wonder nothing gets written to /var/www/gallery4/ws_log.log.

I am not sure how I found this parameter - only 8 hits on google for it.

Now what? Surely that isn't just the end of logging for web services? It must have been replaced with some other logging function, but how to enable it?

Offline

 

#4 2017-01-03 11:01:18

eliz82
Member
Romania
2016-04-27
191

Re: Further logging for ws.php

something about this
http://piwigo.org/doc/doku.php?id=dev:c … 2.8#logger

but no idea how to use it. seems the logs are stored in _data/logs

Offline

 

#5 2017-01-03 11:03:53

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

Yes, I have logs in _data/logs but nothing relating to ws.php, only where I have uploaded a file through a browser. That logger documentation looks to me like it is for developers, not end-users.

Offline

 

#6 2017-01-03 14:20:03

flop25
Piwigo Team
2006-07-06
6603

Re: Further logging for ws.php

troffasky wrote:

That logger documentation looks to me like it is for developers, not end-users.

yes but you can add your own spinet code using this logger method to get whatever you want as data to debug
the ws methods are very to spot so you can edit them easily
If you coded a good way to log ws actions, you can submit us a Pull Request
Here are some examples https://github.com/Piwigo/Piwigo/search … p;q=logger


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2017-01-04 22:54:25

reddn
Member
DC, USA
2015-09-29
27

Re: Further logging for ws.php

How exactly are you uploading from shotwell?

Offline

 

#8 2017-01-05 16:29:12

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

Select image(s), click Share. It goes through the motions and the category is created but no images are uploaded and no error is reported.

However...

I tested regalandroid and was able to upload images, so web services appear to be OK. I had a look through the logs and the last time it was working for me I was using Shotwell 0.22. I downgraded Shotwell from 0.25 to 0.22 and it works!

On the Shotwell bug tracker there was a bug recently fixed regarding Piwigo export:

https://bugzilla.gnome.org/show_bug.cgi?id=776664

so I will focus my efforts there.

Offline

 

#9 2017-01-05 20:29:43

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

Using snapshot.debian.org I have installed various versions of Shotwell and determined that  0.24.0 worked and 0.25.1 doesn't.
Tested uploading the same tiny JPEG to the same category with each version.
Packet capture shows 0.25 sends "Accept-Encoding: gzip, deflate" as part of the POST but 0.24 doesn't. This doesn't seem a likely culprit. Further digging in the packet capture leads me to believe that Shotwell 0.25 just doesn't POST the image - the Content-Length is only 733 bytes, and that causes Piwigo to generate a "forbidden file type" response. The Content-Length when posting the same file with 0.24 is ~27kB.
I will open a bug with shotwell.

Offline

 

#10 2017-01-05 21:28:16

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

Offline

 

#11 2017-01-07 20:54:18

troffasky
Member
2015-06-13
13

Re: Further logging for ws.php

OK, so I am not sure how, but this basically seems to be working now. All I've done is attempt to git bisect Shotwell, get nowhere doing so, rebuild it, and it now it works with the absolute latest version of Shotwell and every version in between.

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2017 · Contact