HTTP 500 on ARMv7 when initially F3 DEBUG is 0

by jernst, Sunday, January 07, 2018, 06:14 (2301 days ago)

This is very strange, and I do not expect anybody to have an answer, but I'd like to just report what I'm seeing.

Background: I build the UBOS Linux distro, which makes it simple to install and maintain web applications on a variety of devices from single-board to cloud. Selfoss has been one of the available apps for quite some time, and it has been working just fine.

We are building the Selfoss package identically on x86_64, ARMv6 (Raspberry PI Zero and One), ARMv7 (Raspberry PI 2 and 3) and aarch64 (ESPRESSObin) and we are running the exact same smoke tests. Recently, the smoke test on the Raspberry Pi 3 has started failing -- all the others still work.

Sequence of steps to reproduce:

  • On Raspberry Pi 3 running UBOS, spin up a Linux container also running UBOS (we smoke test apps in a container)
  • In the container, deploy Selfoss (which includes scripted web server configuration etc)
  • From outside of the container, invoke curl on the Selfoss front page
  • Expectation: HTML of the front page
  • Actual result: HTTP 500. Apache server log says "The each() function is deprecated. This message will be suppressed on further calls". (Presumably this is harmless)

If I go into the web server directory, and invoke "php index.php", I get slightly more:

The each() function is deprecated. This message will be suppressed on further calls
an error occured

(yes, including the misspelling of "occurred")

Here comes the strange part. If I edit "common.php" and change this line:

$f3->set('DEBUG', 0);

to this:

$f3->set('DEBUG', 1);

the home page comes up correctly. But then if I change it right back to

$f3->set('DEBUG', 0);

it continues to work correctly.

Restarting Apache makes no difference in behavior. Once I set DEBUG to 1, there is a difference in the content of the "public" folder, but that's the only difference I could notice. However, if I preserve the original "public" folder, set DEBUG to 1 so it rewrites it, then set DEBUG back to 0 and replace the rewritten "public" folder with the preserved one, it continues to work.

Beats me.

This is PHP 7.2.0, Apache 2.4.29.

HTTP 500 on ARMv7 when initially F3 DEBUG is 0

by jtojnar, Sunday, January 07, 2018, 07:47 (2301 days ago) @ jernst

Some of the libraries we use did not support PHP 7.2 until recently, it should be fixed in the development version. In particular, this error originated from the CSS minifier, which is only invoked when there is no all.css file in the public directory and the DEBUG mode is disabled. The CSS is generated on each request in the DEBUG mode but it is not minified.

HTTP 500 on ARMv7 when initially F3 DEBUG is 0

by jernst, Monday, January 08, 2018, 05:25 (2300 days ago) @ jtojnar

Ah! Thanks for the prompt response.

I don't really want to ship a development version to users. So I'm now doing this when putting the package together:

cp index.php index-tmp.php
cp common.php common-tmp.php
perl -pi -e "s!/common.php!/common-tmp.php!" index-tmp.php
perl -pi -e "s!set\('DEBUG', 0\)!set('DEBUG', 1)!" common-tmp.php
php index-tmp.php > /dev/null
rm index-tmp.php common-tmp.php

That will generate the CSS file (although not minified, but that's the smaller problem IMHO) and now smoke tests pass.

HTTP 500 on ARMv7 when initially F3 DEBUG is 0

by jtojnar, Monday, January 08, 2018, 08:41 (2300 days ago) @ jernst

Note that there are more PHP 7.2 incompatibilities that will probably not be fixed by this, see https://github.com/SSilence/selfoss/issues/983.

Also, most of the time, the development version is actually more stable than the stable one. Many people including the developers use it and any bugs are usually quickly discovered and fixed. So if there were no commits in the last week or two, the development version is probably safe to use.

RSS Feed of thread
powered by my little forum