Libretime: Blank page on login

Created on 13 May 2018  路  24Comments  路  Source: LibreTime/libretime

Ubuntu 16.4.04 on vmware dedicated host.
I have two near identical hosts. One - after apt-get upgrade (I think) - developed the following login problem logged below. Result is a blank page after logon instead of GUI. Havent updated the other it seems fine. I figure it's probably something fairly straightforward but I haven't worked it out yet.

Wondering if related to #410
I'm imagining some code needs revision to suit a new version or I roll something back...

Initial install was from vanzeelandj/libretime which is same as current tree. I tried re-running install etc

Tried re-install using 3.0.0-alpha.3 sources having read re: similar issue, but fault persists - event log result same with different version string i.e. 0c34d* rather than 3.0.0.-alpha.3

2018-05-13T11:20:50+10:00 ERR (3): air01 [Logging.php:166 - loggingShutdownCallback()] - Uncaught TypeError: Argument 1 passed to Composer\Semver\Semver::satisfiedBy() must be of the type array, string given, called in /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php on line 37 and defined in /usr/share/airtime/php/vendor/composer/semver/src/Semver.php:53
Stack trace:

0 /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php(37): Composer\Semver\Semver::satisfiedBy('3.0.0-alpha.3', '>=3-stable')

1 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(349): Airtime_View_Helper_VersionNotify->versionNotify()

2 /usr/share/airtime/php/airtime_mvc/application/layouts/scripts/layout.phtml(32): Zend_View_Abstract->__call('versionNotify', Array)

3 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View.php(157): include('/usr/share/airt...')

4 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(888): Zend_View->_run('/usr/share/airt...')

5 /usr/share/ai at /usr/share/airtime/php/vendor/composer/semver/src/Semver.php:53

array (
'type' => 1,
'message' => 'Uncaught TypeError: Argument 1 passed to Composer\Semver\Semver::satisfiedBy() must be of the type array, string given, called in /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php on line 37 and defined in /usr/share/airtime/php/vendor/composer/semver/src/Semver.php:53
Stack trace:

0 /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php(37): Composer\Semver\Semver::satisfiedBy(\'3.0.0-alpha.3\', \'>=3-stable\')

1 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(349): Airtime_View_Helper_VersionNotify->versionNotify()

2 /usr/share/airtime/php/airtime_mvc/application/layouts/scripts/layout.phtml(32): Zend_View_Abstract->__call(\'versionNotify\', Array)

3 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View.php(157): include(\'/usr/share/airt...\')

4 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(888): Zend_View->_run(\'/usr/share/airt...\')

5 /usr/share/ai',

'file' => '/usr/share/airtime/php/vendor/composer/semver/src/Semver.php',
'line' => 53,
)

Most helpful comment

Hi @frecuencialibre :-)
I experienced the same blank page problem after the reinstall. After checking a few logs I discovered that the server was throwing a 503 error. So probably my problem wasn't related to the topic of this issue.

I also noticed these errors in the zendphp.log

 xxx.xxxxxx.xxx Database error: Invalid number of results returned. Should be 0 or 1, but is 2 instead

So I decided to restore the database, after that ran ./install again and all services started working again properly. Not sure what caused the database corruption. But these problems started after the last upgrade. I have to say I'm currently in the progress of moving from Airtime 2.5.1. towards LibreTime. For the migration I'm entirely dropping the Libretime database. After that, I import the Airtime database and as a final step run the install script again to commit database related upgrade changes. My best guess is that something went wrong during this migration cycle. Although I have been testing it for a few times for the past months. Anyway, I think we're ready to finally move to LibreTime this week;-)

Many thanks for all who contribute to this project!

All 24 comments

Sounds like you have PHP 7 installed?
You can install 5.6 at the same time and set it to 5.6
OR just reinstall with Ubuntu 14.04

See zuphzuphs's post here https://community.spiceworks.com/topic/2058442-how-to-install-different-php-5-6-7-0-7-1-in-ubuntu

We started to see the blank page after login a couple of days ago.
The system is the same but I haven't installed any updates.
I checked - the PHP 7 is installed, but it worked fine before.
Also, I tried to return to the initial backup made 10 days ago - it doesn't work, too.

I looked at the VersionNotify.php and added a return statement at the beginning of the versionNotify() function, and I can login now.
So there must be something wrong with the updates checking algorithm or the version value itself, I haven't dug into it yet.

So, some update killed it.
I have seen something like this a couple of times before.
Libretime (and Airtime) holds back updates from a number of packages.

If you have Webmin (or I guess Virtualmin) installed and do a system update from from inside that, it ignores the 'held' status and updates everything anyway. The result is that LT will not run with the updated packages. There are warning about this in the AT Manual (and probably the LT one).

I also found similar when I updated the Xenial kernel version to the one used in 16.10.

Now I just use 14.04 and all works ok.

This seems like a parsing error with the version check. We ran into this before. It can definitely be worked around.

Well, that is encouraging, I got a yard or two of stack faults when I went down this path, Certainly I couldn't get it to run on PHP7.1

I'd prefer to use the later OS and resolve issues as I can, so I've applied the
return;
hack to the beginning of the versionNotify function in VersionNotify.php and that gets me logged in,

I can confirm that this issue will currently occur with a minimal ubuntu 16.04 install, so I expect a recent package update has broken the version check parsing. Had no issues when did original builds of these particular systems, but I have bumped into this more than once and suspect behaviour has changed back and forth between functional and fail as successive package updates have applied.

Will look closer when I get a chance - for now I'm logging in and running preferred 16.04 build

I'm having an issue that seems like it could be related to this. Running Ubuntu 16.04 on AWS. I was getting errors similar to those described here. I checked my version of PHP and it was running 7.0. I removed that and installed PHP 5.6.
I ran ./install again and it looks like PHP 7.0 has been installed again.

Does anybody know what might be going wrong? zendphp.log is showing this:

2018-11-19T02:42:22+00:00 ERR (3): 35.176.240.47 [ErrorController.php:26 - errorAction()] - trim() expects parameter 1 to be string, array given
2018-11-19T02:42:22+00:00 ERR (3): 35.176.240.47 [ErrorController.php:27 - errorAction()] - #0 [internal function]: exception_error_handler(2, 'trim() expects ...', '/usr$

1 /usr/share/airtime/php/vendor/composer/semver/src/VersionParser.php(103): trim(Array)

2 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(39): Composer\Semver\VersionParser->normalize(Array)

3 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(56): Composer\Semver\Semver::satisfies(Array, '>=0-stable')

4 [internal function]: Composer\Semver\Semver::Composer\Semver{closure}(Array)

5 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(57): array_filter(Array, Object(Closure))

6 /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php(48): Composer\Semver\Semver::satisfiedBy(Array, '>=0-stable')

7 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(349): Airtime_View_Helper_VersionNotify->versionNotify()

8 /usr/share/airtime/php/airtime_mvc/application/layouts/scripts/layout.phtml(32): Zend_View_Abstract->__call('versionNotify', Array)

9 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View.php(157): include('/usr/share/airt...')

10 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(888): Zend_View->_run('/usr/share/airt...')

11 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Layout.php(796): Zend_View_Abstract->render(NULL)

12 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Layout/Controller/Plugin/Layout.php(143): Zend_Layout->render()

13 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Plugin/Broker.php(333): Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Z$

14 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_$

15 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()

16 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()

17 /usr/share/airtime/php/airtime_mvc/application/airtime-boot.php(84): Zend_Application->run()

18 /usr/share/airtime/php/airtime_mvc/public/index.php(68): require_once('/usr/share/airt...')

19 {main}

2018-11-19T02:42:22+00:00 ERR (3): 35.176.240.47 [ErrorController.php:54 - errorAction()] - An internal application error has occurred.: ErrorException: trim() expects pa$
Stack trace:

0 [internal function]: exception_error_handler(2, 'trim() expects ...', '/usr/share/airt...', 103, Array)

1 /usr/share/airtime/php/vendor/composer/semver/src/VersionParser.php(103): trim(Array)

2 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(39): Composer\Semver\VersionParser->normalize(Array)

3 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(56): Composer\Semver\Semver::satisfies(Array, '>=0-stable')

4 [internal function]: Composer\Semver\Semver::Composer\Semver{closure}(Array)

5 /usr/share/airtime/php/vendor/composer/semver/src/Semver.php(57): array_filter(Array, Object(Closure))

6 /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php(48): Composer\Semver\Semver::satisfiedBy(Array, '>=0-stable')

7 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(349): Airtime_View_Helper_VersionNotify->versionNotify()

8 /usr/share/airtime/php/airtime_mvc/application/layouts/scripts/layout.phtml(32): Zend_View_Abstract->__call('versionNotify', Array)

9 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View.php(157): include('/usr/share/airt...')

10 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/View/Abstract.php(888): Zend_View->_run('/usr/share/airt...')

11 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Layout.php(796): Zend_View_Abstract->render(NULL)

12 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Layout/Controller/Plugin/Layout.php(143): Zend_Layout->render()

13 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Plugin/Broker.php(333): Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Z$

14 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_$

15 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()

16 /usr/share/airtime/php/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()

17 /usr/share/airtime/php/airtime_mvc/application/airtime-boot.php(84): Zend_Application->run()

18 /usr/share/airtime/php/airtime_mvc/public/index.php(68): require_once('/usr/share/airt...')

19 {main}

It does seem that ./install does pick the PHP version depending on the OS version.

# Enable Apache modules
if $is_ubuntu_bionic; then
    loudCmd "a2enmod rewrite php7.2"
elif $is_ubuntu_xenial || $is_debian_stretch; then
    loudCmd "a2enmod rewrite php7.0"
elif $is_centos_dist; then
    verbose "TODO: enable Apache modules mod_rewrite and mod_php manually"
else
    loudCmd "a2enmod rewrite php5"

source: install

I had similar problems with the version of Zend (not especially the ones you have posted though). In the end I tricked by way around that with ./install --distribution=ubuntu --release=14.04 --ignore-dependencies. It would be nice to have an argument that specifies the PHP version instead.

Correct. If you have 7.1 you are in trouble. Now we know why. Thank you.
It is perfectly fine to have PHP7.1 on Xenial. Indeed, in Xenial, you get security prompts to upgrade from 7.0 to 7.1 ASAP
I finally upgraded to 7.2 using the Ondrej Sury repo, re-ran the install and all was well.

Thanks all, I saw my install break after pulling https://github.com/LibreTime/libretime/commit/ffc48a50d2feef75bf61c07fb1764fc4b399bdee from upstream. I undid that commit in my local working tree with the following command and the error disappeared. emergency blank white screen fix. note that this command will also overwrite any changes you've made locally to tracked files.

git reset --hard 7beadd05b004024d2513408391ac9f336a5ee7fe

the error message I see in zendphp.log is identical to that posted by @BenHippynet , and I too am running php 7.0 on ubuntu 16. What makes folks think this is a php compatability issue? I see a type error directly caused by the introduction of Array():

...trim() expects parameter 1 to be string, array given...

Hmm 7.2 won't work with Zend 1 based upon my testing. We should see if 5.6 can be supported with newer versions of Ubuntu and install that. It's the only version that has been tested fullt with Zend 1 but alas there are not necessarily security updates.

trim()
expects parameter 1 to be string, array given...
What makes folks think this is a php compatability issue?

That is allowed in 5.6 (but deprecated)
Not allowed in 7.x

I have a new machine with Bionic Beaver 18.04 sat here doing nothing. I might try popping LT on that, with PHP5.6, tonight.

So it looks like SemVer is incompatible between the two versions because the original error suggested it needed an Array and now with 7.X it requires a String type.

The issue with using Php 5.6 is that it will no longer have security updates after the end of 2018. And so basically our best bet is to try and get 7.1 to work.

I think that 7.1 is still workable with Zend MVC and it has security updates until December 2019 - see this official php page

Even thought Zend MVC is EOL there aren't any glaring security issues that I'm aware of but PHP has a much bigger attack vector and therefore it is important that we are able to keep LibreTime running with a version of PHP that has security updates.

It looks like we will need to plan on transitioning the software away from Zend 1 MVC by the end of next year at the latest - see #580 for a related issue.

Random thought. There is a PHP clone that I was reading about. I will have another look. Also wonder if there is some automated php version assist tools.

I'm experiencing the same blank page but I'm a bit confused about how to fix it. Our system is running on Xenial with php7.0 (which is installed and configured by the script). Could anyone point me to the recommended method to solve this issue? I tried to install php5.6 by using the Ondrej repository, after that I tried @jelko's workaround by running this install command:

 ./install --distribution=ubuntu --release=14.04 --ignore-dependencies

But it failed to configure/install the php5 modules properly.

Can't you simply install a trusty image?

@itcrowdsource i'm pretty sure the correct route is not to change entire operating systems and php versions. see my previous comment for the git command that eliminated the error for me.

@hairmare @Robbt i think we should revert https://github.com/LibreTime/libretime/commit/ffc48a50d2feef75bf61c07fb1764fc4b399bdee asap while we fix this.

It looks like $latest is already an array when it gets returned from GetLatestVersion here

https://github.com/LibreTime/libretime/blob/ffc48a50d2feef75bf61c07fb1764fc4b399bdee/airtime_mvc/application/views/helpers/VersionNotify.php#L40

The GetLatestVersion method should be called GetLatestVersions to make this clearer than it is now (only tested on Ubuntu Xenial for now)... So yeah, we need to revert ffc48a50d2feef75bf61c07fb1764fc4b399bdee and reopen this until we can figure out why exactly the original issue shows a trace where GetLatestVersion clearly returns a string.

Most likely the underlying issue is somewhere in the actual GetLatestVersions method:

https://github.com/LibreTime/libretime/blob/5b822afe14046157a8d9fbdff103eb383673e6be/airtime_mvc/application/models/Preference.php#L891-L919

@vanzeelandj Can the host that originally had the issue connect to github? It seems the errors we are seeing in the original issues could be explained if this gets triggered:

https://github.com/LibreTime/libretime/blob/5b822afe14046157a8d9fbdff103eb383673e6be/airtime_mvc/application/models/Preference.php#L914-L915

The $config['airtime_version'] most likely contains a string that should be wrapped in an array.

Anyway... The requested revert for ffc48a50d2feef75bf61c07fb1764fc4b399bdee is in #600. It didn't get to testing anything except Ubuntu Xenial and it's 7.0.32-0ubuntu0.16.04.1 PHP version.

I'm reopening this since the original issue wasn't fixed and we still need to figure out why exactly $latest is a string in the original stack trace. Downgrading to a soon to be EOL distro like Ubuntu Trusty certainly isn't the solution to any of the issues raised here. I believe the behaviour @vanzeelandj originally reported might also lead to weird execution paths on PHP 5.x, they just don't get surfaced by an error on PHP 5.

@frecuencialibre
_I'm still experiencing the blank page after the installation wizard has completed, this is what I did:_

git reset --hard 7beadd05b004024d2513408391ac9f336a5ee7fe
git pull
./install

heya @itcrowdsource ,
i think what you tried didn't work since the git pull command un-did the changes made by the previous git reset command. reset time-travels you to back a previous commit, pull updates your local repository to the most recent commit in the repository from which you're pulling.

anyway, that reset solution was just a temporary band-aid in case you had an emergency situation.

i can now confirm this blank page problem has been fixed in the main Libretime repo, so please try again updating your local repository:

git pull

if you then run git status you should see something like:

On branch master
Your branch is up-to-date with 'origin/master'.

now, i'm not sure what your setup is, but basically you'll have to ensure that the changes you just pulled are present in the code being run by apache.

specifically line 48 of the offending file, VersionNotify.php, which by default is here: /usr/share/airtime/php/airtime_mvc/application/views/helpers/VersionNotify.php, should look exactly like this:
https://github.com/LibreTime/libretime/blob/6031d953518b1f2f87d589de262e3a4a44e70ffc/airtime_mvc/application/views/helpers/VersionNotify.php#L48

your apache logs will tell you the location of the file that is causing the error. logs in ubuntu 16 are typically here: /var/log/apache2/error.log. if this is true on your system then this command will show you the last 100 lines:

sudo tail -n 100 /var/log/apache2/error.log

good luck!

Hi @frecuencialibre :-)
I experienced the same blank page problem after the reinstall. After checking a few logs I discovered that the server was throwing a 503 error. So probably my problem wasn't related to the topic of this issue.

I also noticed these errors in the zendphp.log

 xxx.xxxxxx.xxx Database error: Invalid number of results returned. Should be 0 or 1, but is 2 instead

So I decided to restore the database, after that ran ./install again and all services started working again properly. Not sure what caused the database corruption. But these problems started after the last upgrade. I have to say I'm currently in the progress of moving from Airtime 2.5.1. towards LibreTime. For the migration I'm entirely dropping the Libretime database. After that, I import the Airtime database and as a final step run the install script again to commit database related upgrade changes. My best guess is that something went wrong during this migration cycle. Although I have been testing it for a few times for the past months. Anyway, I think we're ready to finally move to LibreTime this week;-)

Many thanks for all who contribute to this project!

Sorry to hear that your db migration was such a pain 鈽癸笍 I opened up https://github.com/LibreTime/libretime/issues/604 to address the error message you were able to work around by resetting the DB.

DB migrations should happen on the first request to the php mvc parts of LibreTime. We have been scheming to refactor those to happening in a controlled manner since about https://github.com/LibreTime/libretime/issues/129#issuecomment-289297721, feel free to chip in if you have some "hacking legacy php code time" to contribute 馃槒

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please chat to us on discourse or ask for help on our chat if you have any questions or need further assistance with this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kmahelona picture kmahelona  路  5Comments

celianvdb picture celianvdb  路  11Comments

hairmare picture hairmare  路  14Comments

xabispacebiker picture xabispacebiker  路  13Comments

hairmare picture hairmare  路  5Comments