Hello/Hi/Greetings,
I have decided to use Piwigo to handle my family photos instead of buying a NAS at home. I own a server with plenty of capacity, RAM and SSD RAID drives which is co-located in a data center. So, why not?
Downloaded and installed, all went pretty smooth. Ubuntu 18.04 LTS
I am having a problem which I noticed other have had back in 2014 through 2017.
I searched the support forum: (https://piwigo.org/forum/search.php?search_id=702398893)
Terms: "Invalid JSON response add user"
Results: 1 item: https://piwigo.org/forum/viewtopic.php?id=28783
Which linked to: https://piwigo.org/forum/viewtopic.php? … 19#p168319
Which links to: http://piwigo.org/forum/viewtopic.php?id=23275
If you have posted a clear and effective solution to this problem, I cannot find it.
Problem: When I try to add a user I get a JSON error via JS pop up window: "DataTables warning: table id=userList - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1"
Can you please point me to the solution?
Piwigo version: 2.10.1
PHP version: 7.3.13-1+ubuntu18.04.1+deb.sury.org+1
MySQL version: 8.0.18
Piwigo URL: https://www.peavyhome.com - not accessible to public without directory auth
Offline
The answers seem to be in the links you posted.
https://piwigo.org/forum/viewtopic.php? … 21#p168321
1v4r wrote:
The problem here is the warning-message being displayed. It will show up in any output including the JSON-responses and that corrupts the JSON information.
Turing off php error_reporting in the config-files solved the problem.
https://piwigo.org/forum/viewtopic.php? … 96#p149496
Sathi wrote:
This is working great for me now. Thanks guys.
btw: I edited the config the way I did because include/config_default.Inc.php instructed me to do it this way. Here is the code comment in it:
// this permit to show the php errors reporting (see INI 'error_reporting'
// for possible values)
// gives an empty value '' to deactivate
$conf['show_php_errors'] = E_ALL;
In case anyone else is reading this and it looking to do the same thing, I deactivated the warning messages with the following in the config file:
$conf['show_php_errors'] = E_ERROR;
If that doesn't help, then the error message you posted appears to link to step-by-step instructions how to diagnose the problem.
derrickpeavy wrote:
For more information about this error, please see http://datatables.net/tn/1
Offline
So, let me see if I understand this...
This is a problem that other people have had...
This is a problem which Piwigo does not want to solve.
This is a problem that you want your users to solve for you. And as I've looked over the forum, I see that this is the typical attitude from the team about problems. Many times you state that the problem has been explained and a solution posted, but nope. No solution has been posted.
First off, I'm familiar with the developer menu in browsers.
Second, looking for an Ajax resource which you refuse to name is maddening.
Third, I as an end user should not have to solve a problem that is clearly the result of program logic and or choices.
So, no thanks. Good luck to you. I'll find a different solution.
Offline
What Ajax resource? Anyway, the solution probably is the PHP error/warning message handling as mentioned you refused to try, so add that to your Piwigo's local/config/config.inc.php
Good bye, and good luck.
Offline
Yeah, I actually DID try that. In fact I looked for multiple places in source where the error would be shown and changed them (back and forth). Thing is, if I am having to edit the source, then this is something you guys should fix. Anyway, great concept. Hope it continues to grow.
Last edited by derrickpeavy (2020-01-03 19:14:06)
Offline
If you looked in multiple places and edited back and forth you did not try what was said. It is not editing sources, it is one configuration value to be added to local/config/config.inc.php which can also be done using [extension by Piwigo Team] LocalFiles Editor
Offline
derrickpeavy wrote:
a problem that is clearly the result of program logic and or choices.
That is not a logical conclusion. There are thousands of other users who don't have your error.
If you don't want to help solve the problem then good luck I guess.
Last edited by executive (2020-01-04 01:17:54)
Offline
Hi.
Disclaimer: I am not the expert, take the solution I used below with a grain of salt ;)
0) Make a backup of ./admin/user_list_backend.php in case if the changes below causes a problem.
1) vi ./admin/user_list_backend.php
2) Modify the line below
GROUP_CONCAT(name ORDER BY name SEPARATOR ", ") AS groups
to
GROUP_CONCAT(name ORDER BY name SEPARATOR ", ") AS grps
3)Modify the line below
$groups_of_user[ $row['user_id'] ] = $row['groups'];
to
$groups_of_user[ $row['user_id'] ] = $row['grps'];
4) save your changes
5) Clear the cache in your browser
6) Reload the piwigo web page and to Admin -> Users -> Manage
I believe that "groups" is a keyword that MySQL 8.x.
Hopefully, this works for you.
Offline
Hello Hello !
I am a basic user and do not not understand much to code.
Can you confirm what I understand of the soluces proposed above, please ?
Adding
$conf['show_php_errors'] = E_ERROR;
in local config only hides the errors, but does not mend them.
So the stated errors are still to be corrected.
Maybe the soluce by Rock is the one, but I am waiting for a Piwigo coder to tell.
Thanks for helping, everybody.
Offline
Funny enough I'm now getting that very error as well in my installation after a switch to MySQL 8.
I confirm that this
rock wrote:
1) vi ./admin/user_list_backend.php
can help, though already quoting the groups name solves the problem. So, change line 204 to
GROUP_CONCAT(name ORDER BY name SEPARATOR ", ") AS `groups`
The original code causes this MySQL error message to be the "JSON" response:
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 'groups FROM piwigo_user_group JOIN `piwigo_groups` ON id = group_id WHER' at line 3 SELECT user_id, GROUP_CONCAT(name ORDER BY name SEPARATOR ", ") AS groups FROM piwigo_user_group JOIN `piwigo_groups` ON id = group_id WHERE user_id IN (1,2,3,4,5) GROUP BY user_id ; in .../include/dblayer/functions_mysqli.inc.php on line 856
Katryn wrote:
Adding ... in local config only hides the errors, but does not mend them.
So the stated errors are still to be corrected.
Right. But iff what was stated
executive wrote:
https://piwigo.org/forum/viewtopic.php?pid=168321#p168321
1v4r wrote:
The problem here is the warning-message being displayed. It will show up in any output including the JSON-responses and that corrupts the JSON information.
Turing off php error_reporting in the config-files solved the problem.
held, then PHP displaying a warning message that creeps into the JSON response could had been the underlying cause here. However, back then when that answer was given it was for a different scenario and is not applicable here.
Offline
Thanks ! I understand better.
Offline
In fact that has already been addressed on the 2.10 branch,
[Github] Piwigo commit a3898f96
Offline
I'll keep this thread bookmarked in case I come back to Piwigo. At the moment, I've moved on to using Wordpress and the FooGallery and FoodBox theme and have my gallery up and running.
There is clearly a need for a package like Piwigo. However, there are (to me) red flags all over the product.
The first is that any one would be using reserved words in MySQL. I first encountered reserved words back in 1998 when I first started working with databases. Actually, it was back in 1993 with FileMaker, but I assumed that was just a FileMaker thing. The lesson learned was to never use a reserved word. Period. In working with hundreds of databases since, and writing against those for business cases, I have never used reserved words. Just because you "can" by quoting them is not good practice.
Second, the requirements to run the package. I have a clean 18.04 LTS system on my own server, 48 GB of RAM, RAID0 SSD's in a datacenter. I run the latest PHP, MySQL, Tomcat and Java. But for Piwigo, there are several recommended tools (not required, I know), found here >> https://piwigo.org/doc/doku.php?id=user … ll:before. Those were not a problem, but the average user might have a problem even being allowed to install these things. Though with virtualization, it's less of a problem. Biggest hurdle was ImageMagick. Ubuntu is stills spitting out Image Magick 6. I rely on ImageMagic for another application and so took the practive step to compile version 7 from source before installing Piwigo to avoid any headaches later on.
Third, I did scan the forums before installing. I saw the references to MySQL reserved words, understood that some of that had been dealt with (through quoting, ugh), and also saw the problems with the JSON response. But as they say, all developers are optimists, so I thought, 'meh, it's a clean install, probably fine.'
Which brings me to the fourth problem - the fact that in just this thread alone, other people are pointing out errors in the underlying PHP code. If I wanted to tinker with another code base I would just build my own gallery. I don't want that on my plate. I want to install, use and move on. I have about 500 GB of photos I want to store and I don't want the headache of both dealign with the code and securing the photos for life.
The fifth problem is the attitude that is prevalent throughout the forums from the developer(s) of Piwigo. When this or other problems are pointed out, the response seems to be "search the forums" or "we've already explained that." I get that time is not infinite. However, if a problem comes up enough, a developer should do two things: 1) Fix it and 2) Keep a handy text file with the procedure to fix the problem and paste that into a response. It's not that hard.
Finally, the mobile theme. Does't work very well. When I loaded a gallery (4 photos), the screen was unresponsive for up to a minute, and on subsequent loads, not at all. Nothing responded, not the arrows at the bottom, not scrolling, nothing. Only closing the tab worked. When the mobile theme did initially work, the photos were subject to move out of the screen frame and that's not something I want to deal with when sharing the site with friends and family. Bad enough that the grandparents expect me to install a printer from 200 miles away. Worse that they finally got to the site on their phone, clicked a photo and nothing happened.
I am sure that the developer(s) of Piwigo have put in thousands of hours and are surely stressed at times. However, the attitude is a real killer. Today, with so many WordPress themes and virtualized storage solutions (Digital Ocean), people have options. A bad attitude can kill a project.
Offline
derrickpeavy wrote:
I'll keep this thread bookmarked in case I come back to Piwigo. At the moment, I've moved on to using Wordpress and the FooGallery and FoodBox theme and have my gallery up and running.
Good luck with Wordpress then.
The first is that any one would be using reserved words in MySQL. I first encountered reserved words back in 1998 when I first started working with databases. Actually, it was back in 1993 with FileMaker, but I assumed that was just a FileMaker thing. The lesson learned was to never use a reserved word. Period. In working with hundreds of databases since, and writing against those for business cases, I have never used reserved words.
You seem to have some crystal ball running, could someone borrow it from you? In your great wisdom you may have overlooked that the code in question is much older than MySQL 8, which introduced a bunch of new reserved words that previously were not reserved.
Which brings me to the fourth problem - the fact that in just this thread alone, other people are pointing out errors in the underlying PHP code. If I wanted to tinker with another code base I would just build my own gallery. I don't want that on my plate. I want to install, use and move on.
If there is a problem with code and the cause is identified you have two options: either patch your installation or wait until the next release. There is no point in whining "but I want to have my problem addressed immediately by the responsible developer'. If you want such support then create a gallery on piwigo.com for a sensible fee.
The fifth problem is the attitude that is prevalent throughout the forums from the developer(s) of Piwigo.
I doubt you encountered many of them. Plg is a helpful guy if he finds time and most others are not core developers.
When this or other problems are pointed out, the response seems to be "search the forums" or "we've already explained that."
Because many times that is the case. New users almost never search for anything before posting.
Also, most people are not native English speakers; things sometimes may come across in odd ways.
I get that time is not infinite. However, if a problem comes up enough, a developer should do two things: 1) Fix it and 2) Keep a handy text file with the procedure to fix the problem and paste that into a response. It's not that hard.
You overlook that most users in this forum are just that, not developers but users of Piwigo who try to help each other; me included.
Offline
My apologies for assuming the responses I saw in the forums were from developers. But they seemed rather.. "authoritative?"
Community help is appreciated, thank you, and thank you for responding.
As for the crystal ball, no. Just a difference in approach. MySQL 8 not only introduced more reserved words, but also has some other annoying headaches - Only_Full_Group_By being one of the most annoying. IN fact, I debated (and still a debating) disabling that. There are just too many places where it's convenient to disable it, or it doesn't need to be full group by. But, I haven't and hope that I don't because I know that the default install is the most common. And, leaving it on develops a better habit on my part of writing better queries. The point being that when a change like this is rolled out by MySQL, I personally feel that is justification for changing the table column names (in the case of reserved words).
As for WordPress, I am skeptical of using it. However, the Enviro and Foo plugins are being used on thousands (tens of thousands?) of sites with thousands of photos. Foo seems like a better choice because it adheres to the WP standards a bit more. To me the problem probably is not Piwigo or WordPress, but the connection and capacity of the server.
I have zipped dup my install of Piwigo and will keep it handy If the WordPress install does not work out, then I will come back and give this another go.
Offline