Announcement

#1 2021-10-01 00:53:47

wildbi111
Member
2019-03-15
24

Piwigo Update error

I got this error when checking for update:

Check for update failed for unknown reasons.

Also am getting error when attempting to upload an image:

Give write access (chmod 777) to "upload" directory at the root of your Piwigo installation

But chmod 777 ./upload has not affect.

Offline

 

#2 2021-10-01 11:01:41

erAck
Only trying to help
2015-09-06
1395

Re: Piwigo Update error

If contacting the Piwigo update server fails since only yesterday: make sure your hosting providers has taken measures installing new root certificates. piwigo.org uses Let's Encrypt certificates and the Let's Encrypt root certificate expired yesterday so if it wasn't updated on your host the validity check of other Let's Encrypt certificates will fail.

Regarding write permissions, so what permissions do these have?
upload
upload/2021

Note that 777 usually isn't even necessary but the important part is that the user the web server runs as has write permissions in the upload directory and subdirectories.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-10-01 20:07:48

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

erAck

I also use a letsencrypt cert and it is not set to expire until mid-December.  When I go to 'Tools" and click on 'updates' I get "Check for update failed for unknown reasons".  When I go to 'Tools' then 'Maintenance' and click on 'Check for upgrade' I get "Unable to check for upgrade".

The permissions for the two directories are:

drwxrwxrwx.  7 apache apache    68 Sep 28 12:13 upload

drwxrwxrwx.  7 apache apache 56 Sep 28 12:13 2021

The httpd service runs as 'apache'

Bill

Offline

 

#4 2021-10-01 20:22:46

erAck
Only trying to help
2015-09-06
1395

Re: Piwigo Update error

It's not your LE certificate that expired, it is the LE CA X3 root certificate that expired, see https://letsencrypt.org/docs/dst-root-c … mber-2021/ and if your host machine does not have its ca-certificates bundle upgraded then it can't connect to servers that use a LE certificate anymore.

If that is the reason for your "Unable to check for upgrade" you can check if you ssh to your host machine and on the command line issue the command

Code:

curl -iIsSv https://piwigo.org/

that should not report a verification error.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2021-10-01 20:37:59

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

Yes, I understand that its not my cert.  I ran the curl cmd and got the following which looks ok to me.


*   Trying 51.38.237.64...
* TCP_NODELAY set
* Connected to piwigo.org (51.38.237.64) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=piwigo.org
*  start date: Sep  4 15:56:12 2021 GMT
*  expire date: Dec  3 15:56:11 2021 GMT
*  subjectAltName: host "piwigo.org" matched cert's "piwigo.org"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
> HEAD / HTTP/1.1
> Host: piwigo.org
> User-Agent: curl/7.61.1
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx
Server: nginx
< Date: Fri, 01 Oct 2021 18:33:01 GMT
Date: Fri, 01 Oct 2021 18:33:01 GMT
< Content-Type: text/html; charset=UTF-8
Content-Type: text/html; charset=UTF-8
< Connection: keep-alive
Connection: keep-alive
< Set-Cookie: pwg_id=4ejbpq7cnbo92fqd42178tfugu; path=/; HttpOnly
Set-Cookie: pwg_id=4ejbpq7cnbo92fqd42178tfugu; path=/; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
Pragma: no-cache

<
* Connection #0 to host piwigo.org left intact

Offline

 

#6 2021-10-01 21:25:42

erAck
Only trying to help
2015-09-06
1395

Re: Piwigo Update error

Yes, that's fine.

You can check if connecting from PHP works at all, see [Forum, post 180108 by erAck in topic 31104] Check for update failed for unknown reasons..


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2021-10-04 01:20:34

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

Running  php filename.php resulted in:

"Good connection to piwigo.org"

A few days ago during a routine dnf update I saw what I think was a root certificates update.  But not 100% sure.  I ran "dnf list|grep -i cert" and the only thing I saw that looked relevant was "ca-certificates.noarch".  I was thinking that a cert update had messed things up.

Other than that I'm still scratching my head.

Bill

Offline

 

#8 2021-10-05 01:28:49

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

Further digging shows errors such as "Connection to server unavailable.", so I began looking at my firewall to see if traffic is allowed to piwigo.org and my firewall (shorewall) responds with "piwigo.org already allowed".  Is there possibly another site that updates are pulled from that I may have inadvertently blocked?

Offline

 

#9 2021-10-05 02:54:38

erAck
Only trying to help
2015-09-06
1395

Re: Piwigo Update error

Surely your firewall has some logging function to find out what is requested?

Anyway, depending on which localization/language you run Piwigo in there may be subdomains involved, like fr.piwigo.org or de.piwigo.org; see upgrade.php for a possible list (search for PHPWG_DOMAIN).


Running Piwigo at https://erack.net/gallery/

Offline

 

#10 2021-10-05 20:14:59

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

erAck

Yes, I've been checking to firewall logs and see nothing. 

I've told the firewall to specifically allow piwigo.org, fr.piwigo.org and de.piwigo.org but it is alredy allowed.

#  shorewall allow piwigo.org
   WARNING: piwigo.org already allowed (not dynamically blacklisted)
# shorewall allow de.piwigo.org
   WARNING: de.piwigo.org already allowed (not dynamically blacklisted)
# shorewall allow fr.piwigo.org
   WARNING: fr.piwigo.org already allowed (not dynamically blacklisted)

I have used tcpdump to watch for traffic to piwigo.org and see nothing leaving the interface (eth0).

I am able to reach piwigo from the CLI using curl with no errors.  So I'm currently stumped!

Bill

PS - Only 1 active language "English [UK] (default)"

Last edited by wildbi111 (2021-10-05 20:20:44)

Offline

 

#11 2022-04-09 19:51:57

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

I have solved the upload image permissions issue.  It turns out it was an selinux issue.  The following commands fixed the problem:

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/yoursite/(/.*)?"
restorecon -R -v /var/www/yoursite/
systemctl restart httpd

Now the only problem is I am unable to update via the web admin interface.  When I click on "Check for upgrade" I get "Unable to check for upgrade"

I am using Piwigo 11.5.0

Offline

 

#12 2022-04-09 21:57:02

erAck
Only trying to help
2015-09-06
1395

Re: Piwigo Update error

Thanks for reporting the solution back here :-)

For the upgrade problem try to temporarily edit admin/include/functions.php and in function fetchRemote() begin log or echo $src to see what is tried. If that's plausible and can be reached from PHP on your host then sprinkle some debug messages in all return false branches..


Running Piwigo at https://erack.net/gallery/

Offline

 

#13 2022-04-14 20:03:17

wildbi111
Member
2019-03-15
24

Re: Piwigo Update error

erAck - With my limited php programing skills I am unable to see the contents of the php $src variable.  I have looked at the php files you suggested to no avail. 

I did a recursive grep for "unknown reasons" and the error seems to be generated from:
./admin/themes/default/template/updates_pwg.tpl as  added a few extra characters to the word 'update' and it display when checking for updates.

I can access piwigo.org from the command line with the php script you pointed me to a while back and with wget, etc.

Last edited by wildbi111 (2022-04-14 20:52:50)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact