Bug 29319 - zoneminder (Mga8) is missing require:- php-ctype & zmsetup fails if mysql root pw already exists
Summary: zoneminder (Mga8) is missing require:- php-ctype & zmsetup fails if mysql roo...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-08-02 10:52 CEST by frederic henry-couannier
Modified: 2021-08-14 16:01 CEST (History)
3 users (show)

See Also:
Source RPM: zoneminder-1.34.22-1.mga8.tainted.src.rpm
CVE:
Status comment:


Attachments
log file as required (1.05 KB, application/x-xz)
2021-08-03 09:54 CEST, frederic henry-couannier
Details

Description frederic henry-couannier 2021-08-02 10:52:33 CEST
Description of problem:
zoneminder web pages do not open , or are incomplete



How reproducible:
any time

Steps to Reproduce:
1. install zoneminder rpm
2. sudo zmsetup which creates database
3. browse http://localhost/zm

there are many errors in httpd logs of the kind : PHP Fatal error:  Uncaught Error: Call to undefined function ZM\\ctype_digit() in /usr/share/zoneminder/www/includes/Object.php:14
Comment 1 Lewis Smith 2021-08-03 09:24:46 CEST
Thank you for the report, and apologies for the trouble you are having.

Are you able to create an httpd log showing just the errors from this application as per step 3 above? - which should not be big. Then attach this log file to the bug; you can add a full comment at the same time. If it is very big, compress it first with:
 $ xz -k <logfile>
which should produce logfile.xz (to attach).

CC: (none) => lewyssmith
Source RPM: zoneminder 1.34.22-1.mga8.tainted => zoneminder-1.34.22-1.mga8.tainted.src.rpm

Comment 2 frederic henry-couannier 2021-08-03 09:54:56 CEST
Created attachment 12884 [details]
log file as required
Comment 3 frederic henry-couannier 2021-08-03 09:55:31 CEST
done !
Comment 4 Lewis Smith 2021-08-03 10:43:21 CEST
Thank you for that. (The raw log file was only 34Kb, that was fine to attach uncompressed).

Assigning to BarryJ, the maintainer of this. You have already committed several newer versions since one (1.34.23/26, 1.36.1/4), so perhaps one of those would do the trick.

@frederic : when an update does get pushed to tainted/updates_testing (which you will see on this bug), can you please try it.

CC: lewyssmith => (none)
Assignee: bugsquad => zen25000

Comment 5 Barry Jackson 2021-08-03 13:09:19 CEST
Hi Frederic,
Would you please post the output as user of:

rpm -qa|grep php-ctype

Thanks,
Barry
Comment 6 frederic henry-couannier 2021-08-03 13:39:03 CEST
i get empty output for rpm -qa|grep php-ctype
Comment 7 Barry Jackson 2021-08-03 15:40:26 CEST
Thanks Frederic,
Please try this:

su

urpmi php-ctype

zmrestart

exit

See if that fixes the problem.
Comment 8 frederic henry-couannier 2021-08-03 16:00:50 CEST
Yes now it works!
Comment 9 frederic henry-couannier 2021-08-03 16:01:58 CEST
so it was just a missing package for zm to work ?
Comment 10 frederic henry-couannier 2021-08-03 16:02:28 CEST
thanks
Comment 11 frederic henry-couannier 2021-08-03 16:11:25 CEST
but i noticed something strange : after you asked me to check wether php-ctype was installed and found that ot was not a installed it and restarted zoneminder service with te CCM tool, and it was still not working: only with your command zmrestart dit it start to work !
Comment 12 Barry Jackson 2021-08-03 17:49:27 CEST
Thanks Frederic,
Yes the zmrestart command closes zoneminder, then mysql and then apache and re-starts them all again in the correct order.
It was the re-start of apache (the http server) that was needed to pick up the new php package.

I knew that later versions of zoneminder needed php-ctype but I had missed that it was needed in the current Mga8 version when it was released.

Thanks for reporting this.

Changing bug summary.

Summary: zoneminder webpages do not open , or are incomplete => zoneminder (Mga8) is missing require:- php-ctype

Comment 13 frederic henry-couannier 2021-08-03 19:58:38 CEST
All right!
Comment 14 Barry Jackson 2021-08-06 19:08:44 CEST
zoneminder-1.34.22-1.1.mga8 has been submitted to 8/tainted/updates_testing

##################
Advisory

This update fixes a problem with the Web GUI caused by a missing dependency required by this version of zoneminder.

It also resolves an issue in the zmsetup script that could arise when updating to this version from an earlier one, if a mysql root password was already set.

This later version of the script requires that a mysql password is set and that any existing one is entered during set-up.

##################
Affected packages

zoneminder-debugsource-1.34.22-1.1.mga8.tainted.x86_64.rpm
zoneminder-1.34.22-1.1.mga8.tainted.x86_64.rpm
zoneminder-debuginfo-1.34.22-1.1.mga8.tainted.x86_64.rpm

zoneminder-debugsource-1.34.22-1.1.mga8.tainted.i586.rpm
zoneminder-1.34.22-1.1.mga8.tainted.i586.rpm
zoneminder-debuginfo-1.34.22-1.1.mga8.tainted.i586.rpm

From:-
zoneminder-1.34.22-1.1.mga8.tainted.src.rpm

#################
Reference

https://bugs.mageia.org/show_bug.cgi?id=29319

#################
Testing

Install original version of zoneminder, and run the zmsetup script as requested in the README.urpmi

If you already have a mysql root password then the setup may fail.

If it comletes, copy the url at the end of the setup into Firefox otherwise you can still check the GUI using localhost/zm and see that there are no GUI elements in the web page, only text.

Update to the new version and again run zmsetup which will ask for your existing mysql root password (if one is set) or ask to create one.

It will then test the mysql database and upgrade it if neccesary, which can be slow, but progress is indicated.

Then it checks the zoneminder database and updates it if needed.

On completion there should be a Url given as before, which should show a proper Web interface with GUI.

Assignee: zen25000 => qa-bugs
Summary: zoneminder (Mga8) is missing require:- php-ctype => zoneminder (Mga8) is missing require:- php-ctype & zmsetup fails if mysql root pw already exists

Comment 15 Herman Viaene 2021-08-07 20:50:49 CEST
MGA8-64 Plasma on Lenovo B50
No installation issues.
Made sure mysqld is running.
At CLI:
# zmsetup
*** Welcome to ZoneMinder Setup ***
Checking the current ZM_USER_PASSWORD...
The password is not strong enough, it is based on a dictionary word.
Passwords should have at least eight characters with no dictionary
words or common sequences.
Please enter a new one now. (hint: write it down first as it will not be displayed)
New password: 
OK
Repeat password: 
Passwords differ, please start again
New password: 
OK
Repeat password: 
Please wait a moment...
You do not appear to have a mysql root password set.

Passwords should have at least eight characters with no dictionary
words or common sequences.
Please enter a new one now. (hint: write it down first as it will not be displayed)
New password: 
OK
Repeat password: 
Set new password now - confirm - OK? [y/n] y
Please wait ...
Checking mysql database is current, please wait...

Phase 1/7: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.global_priv                                  OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.roles_mapping                                OK
mysql.servers                                      OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.transaction_registry                         OK
Phase 2/7: Installing used storage engines... Skipped
Phase 3/7: Fixing views
mysql.user                                         OK
Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
my_wiki
my_wiki.actor                                      OK
my_wiki.archive                                    OK
my_wiki.bot_passwords                              OK
my_wiki.category                                   OK
my_wiki.categorylinks                              OK
my_wiki.change_tag                                 OK
my_wiki.change_tag_def                             OK
my_wiki.comment                                    OK
my_wiki.content                                    OK
my_wiki.content_models                             OK
my_wiki.externallinks                              OK
my_wiki.filearchive                                OK
my_wiki.image                                      OK
my_wiki.imagelinks                                 OK
my_wiki.interwiki                                  OK
my_wiki.ip_changes                                 OK
my_wiki.ipblocks                                   OK
my_wiki.ipblocks_restrictions                      OK
my_wiki.iwlinks                                    OK
my_wiki.job                                        OK
my_wiki.l10n_cache                                 OK
my_wiki.langlinks                                  OK
my_wiki.log_search                                 OK
my_wiki.logging                                    OK
my_wiki.module_deps                                OK
my_wiki.objectcache                                OK
my_wiki.oldimage                                   OK
my_wiki.page                                       OK
my_wiki.page_props                                 OK
my_wiki.page_restrictions                          OK
my_wiki.pagelinks                                  OK
my_wiki.protected_titles                           OK
my_wiki.querycache                                 OK
my_wiki.querycache_info                            OK
my_wiki.querycachetwo                              OK
my_wiki.recentchanges                              OK
my_wiki.redirect                                   OK
my_wiki.revision                                   OK
my_wiki.revision_actor_temp                        OK
my_wiki.revision_comment_temp                      OK
my_wiki.searchindex                                OK
my_wiki.site_identifiers                           OK
my_wiki.site_stats                                 OK
my_wiki.sites                                      OK
my_wiki.slot_roles                                 OK
my_wiki.slots                                      OK
my_wiki.templatelinks                              OK
my_wiki.text                                       OK
my_wiki.updatelog                                  OK
my_wiki.uploadstash                                OK
my_wiki.user                                       OK
my_wiki.user_former_groups                         OK
my_wiki.user_groups                                OK
my_wiki.user_newtalk                               OK
my_wiki.user_properties                            OK
my_wiki.watchlist                                  OK
my_wiki.watchlist_expiry                           OK
performance_schema
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK
Installing a new ZoneMinder database ...
You do not appear to have a timezone set for php.
This is required for the Web-UI to work.

Added timezone Europe/Brussels to /etc/php.d/05_date.ini 


NOTE: You may need to comment out or edit the line beginning 'ScriptAlias' in
in /etc/httpd/httpd.conf if you cannot view streams and see cgi errors in the log.

Note that the cgi-bin ScripAlias for ZoneMinder is already set in
/etc/httpd/conf/sites.d/zoneminder.conf

Congratulations - ZoneMinder is now running.
You should be able to access the ZM Console in your browser using :-
http://mach5.hviaene.thuis/zm

Some explanation: mysqld had a rather simple password, zm was not happy with that and forced to define a new password.
Then I ccould display the ZM - Privacy page in the browser where you can accept or decline ZM's privacy settings.
Should  be OK.

CC: (none) => herman.viaene
Whiteboard: (none) => MGA8-64-OK

Comment 16 Thomas Andrews 2021-08-11 13:49:48 CEST
Validating. Advisory in Comment 14.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Thomas Backlund 2021-08-14 14:55:30 CEST

Keywords: (none) => advisory

Comment 17 Mageia Robot 2021-08-14 16:01:35 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2021-0168.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.