MacPorts Install problem

For discussion of topics specific to MythTV on OSX
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

In Terminal, getting this (my usual user login is not an admin one, I think this is the problem)

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo port install mythtv.28
Password:
Sorry, try again.
Password:
jbradleyjansen is not in the sudoers file. This incident will be reported.
MacBook-Pro-BigSur:~ jbradleyjansen$

Trying to do this
https://ports.macports.org/port/mythtv.28/
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

BradleyinDC wrote:
Sun Sep 18, 2022 1:05 am
pvr4me wrote:
Sat Sep 17, 2022 2:06 pm
The installer should have started the MySQL database software to run in the background. Please use the Activity Monitor (Utilities) to verify that it (mysqld) is running. In the wiki page, the section "Launch the frontend" shows how to check that "mysqld" is active:

https://www.mythtv.org/wiki/MacPorts#La ... e_frontend
mysqld is not visible in the Activity Monitor window.
As jhoyt says, the MariaDB database software must be running in the background before a Myth system can be made to work. I don't have a Big Sur system and it is possible that some of the changes Apple made will have made it impossible to run the older version of MariaDB that the installer has loaded on your system. However, you can try using Terminal to run the commands that prepare and start the database software from the Terminal. If there are error messages, they may help us understand what is working and not working.

The following link will get you an OLD copy of the MacPorts wiki page that includes the FOUR commands needed to initialize and start the database after setting up PATH:

https://www.mythtv.org/wiki?title=MacPo ... stallation

As the note box says, these used to cause people tonnes of problems. We have to get each one to run correctly, in turn, once.

BTW, just to make things even more complicated, the database software does not have to be running on the machine that you plan to run Myth on. It could be running on another machine on your local area network.

Craig
Formerly the MacPorts guy.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

BradleyinDC wrote:
Sun Sep 18, 2022 12:24 pm
In Terminal, getting this (my usual user login is not an admin one, I think this is the problem)

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo port install mythtv.28
Password:
Sorry, try again.
Password:
jbradleyjansen is not in the sudoers file. This incident will be reported.
MacBook-Pro-BigSur:~ jbradleyjansen$

Trying to do this
https://ports.macports.org/port/mythtv.28/
Don't do this.

It appears that the all-in-one installer loaded all the needed software to your system--the problem is getting it configured and running. Trying to use MacPorts to load the software will just give you two copies (in slightly different locations) but get you no further in configuration.

Craig
PS Terminal will keep nagging you to change your shell from bash to zsh. It causes no harm to stick with bash, though.
Formerly the MacPorts guy.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Sun Sep 18, 2022 12:38 pm
BradleyinDC wrote:
Sun Sep 18, 2022 12:24 pm

Trying to do this
https://ports.macports.org/port/mythtv.28/
Don't do this.

It appears that the all-in-one installer loaded all the needed software to your system--the problem is getting it configured and running. Trying to use MacPorts to load the software will just give you two copies (in slightly different locations) but get you no further in configuration.

Craig
PS Terminal will keep nagging you to change your shell from bash to zsh. It causes no harm to stick with bash, though.
Too late, oops.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Sun Sep 18, 2022 12:32 pm

As jhoyt says, the MariaDB database software must be running in the background before a Myth system can be made to work. I don't have a Big Sur system and it is possible that some of the changes Apple made will have made it impossible to run the older version of MariaDB that the installer has loaded on your system. However, you can try using Terminal to run the commands that prepare and start the database software from the Terminal. If there are error messages, they may help us understand what is working and not working.

The following link will get you an OLD copy of the MacPorts wiki page that includes the FOUR commands needed to initialize and start the database after setting up PATH:

https://www.mythtv.org/wiki?title=MacPo ... stallation

As the note box says, these used to cause people tonnes of problems. We have to get each one to run correctly, in turn, once.

BTW, just to make things even more complicated, the database software does not have to be running on the machine that you plan to run Myth on. It could be running on another machine on your local area network.

Craig
Tried that link, thanks.
Changed my user account to admin which got me passed the password problem, but copy/pasting the commands didn't work for me:

Last login: Mon Sep 19 09:10:31 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo -u _mysql mysql_install_db
Password:
Installing MariaDB/MySQL system tables in '/opt/dvr/var/db/mariadb' ...
220919 9:12:53 [Note] /opt/dvr/lib/mariadb/bin/mysqld (mysqld 5.5.52-MariaDB) starting as process 3725 ...
sudo cp /opt/dvr/share/mythtv/database/my.cnf /opt/dvr/etc/mariadb

Installation of system tables failed! Examine the logs in
/opt/dvr/var/db/mariadb for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /opt/dvr/lib/mariadb/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /opt/dvr/lib/mariadb/bin/mysqld --skip-grant --general-log &

and use the command line tool /opt/dvr/lib/mariadb/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /opt/dvr/lib/mariadb/bin/mysql -u root mysql
mysql> show tables;

Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /opt/dvr/var/db/mariadb that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-sy ... install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

MacBook-Pro-BigSur:~ jbradleyjansen$ sudo cp /opt/dvr/share/mythtv/database/my.cnf /opt/dvr/etc/mariadb
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist
/Library/LaunchDaemons/org.macports.mariadb-server.plist: service already loaded
Load failed: 37: Operation already in progress
MacBook-Pro-BigSur:~ jbradleyjansen$ mysql -u root < /opt/dvr/share/mythtv/database/mythconverg_init.sql
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo -u _mysql mysql_install_db
Installing MariaDB/MySQL system tables in '/opt/dvr/var/db/mariadb' ...
220919 9:18:24 [Note] /opt/dvr/lib/mariadb/bin/mysqld (mysqld 5.5.52-MariaDB) starting as process 15356 ...

Installation of system tables failed! Examine the logs in
/opt/dvr/var/db/mariadb for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /opt/dvr/lib/mariadb/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /opt/dvr/lib/mariadb/bin/mysqld --skip-grant --general-log &

and use the command line tool /opt/dvr/lib/mariadb/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /opt/dvr/lib/mariadb/bin/mysql -u root mysql
mysql> show tables;

Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /opt/dvr/var/db/mariadb that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-sy ... install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

MacBook-Pro-BigSur:~ jbradleyjansen$ sudo cp /opt/dvr/share/mythtv/database/my.cnf /opt/dvr/etc/mariadb
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist
/Library/LaunchDaemons/org.macports.mariadb-server.plist: service already loaded
Load failed: 37: Operation already in progress
MacBook-Pro-BigSur:~ jbradleyjansen$ mysql -u root < /opt/dvr/share/mythtv/database/mythconverg_init.sql
MacBook-Pro-BigSur:~ jbradleyjansen$
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

Did you check if mysqld now appears as a running process in Activity Monitor (as instructed by the wiki page)?
Formerly the MacPorts guy.
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

Another possibility is that the database server software (mysqld) is trying to launch and failing. The way we configure it, macOS will try again every 5 minutes launch mysqld. If this is the case, we may be able to figure out the issue from log file(s) that mysqld creates. In Terminal, enter:

Code: Select all

sudo ls -al /opt/dvr/var/db/mariadb/
There may be one or more files with a name like localhost.err. If so, examine the contents of the most recently created log with:

Code: Select all

sudo cat /opt/dvr/var/db/mariadb/{filename}
Post the results.

Craig
Formerly the MacPorts guy.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Mon Sep 19, 2022 3:07 pm
Did you check if mysqld now appears as a running process in Activity Monitor (as instructed by the wiki page)?
It has never been running
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

So we really need the error log, then.
Formerly the MacPorts guy.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Mon Sep 19, 2022 4:00 pm
So we really need the error log, then.
Tell me where

Is this it?

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo ls -al /opt/dvr/var/db/mariadb/
Password:
total 93392
drwxr-xr-x 14 _mysql _mysql 448 Sep 19 09:18 .
drwxr-xr-x 4 root wheel 128 Sep 15 15:19 ..
-rw-r--r-- 1 root wheel 0 Jan 15 2017 .turd_mariadb-server
-rw-rw---- 1 _mysql _mysql 3 Sep 19 09:09 MacBook-Pro-BigSur.pid
-rw-rw---- 1 _mysql _mysql 761856 Sep 19 09:08 aria_log.00000001
-rw-rw---- 1 _mysql _mysql 52 Sep 19 09:08 aria_log_control
-rw-rw---- 1 _mysql _mysql 5242880 Sep 19 09:09 ib_logfile0
-rw-rw---- 1 _mysql _mysql 5242880 Sep 15 15:21 ib_logfile1
-rw-rw---- 1 _mysql _mysql 18874368 Sep 19 09:08 ibdata1
-rw-rw---- 1 _mysql _mysql 17685334 Sep 19 09:18 localhost.err
drwx------ 74 _mysql _mysql 2368 Sep 15 15:21 mysql
drwx------ 3 _mysql _mysql 96 Sep 19 09:16 mythconverg
drwx------ 20 _mysql _mysql 640 Sep 15 15:21 performance_schema
drwx------ 2 _mysql _mysql 64 Sep 15 15:21 test
MacBook-Pro-BigSur:~ jbradleyjansen$
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

The file is '/opt/dvr/var/db/mariadb/localhost.err' but it has apparently ballooned to about 17 megabytes! Let's try:

Code: Select all

sudo tail -n 50 /opt/dvr/var/db/mariadb/localhost.err
Please copy the 50 lines of output here and we'll see if that helps.

Craig
Formerly the MacPorts guy.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Mon Sep 19, 2022 6:45 pm
The file is '/opt/dvr/var/db/mariadb/localhost.err' but it has apparently ballooned to about 17 megabytes! Let's try:

Code: Select all

sudo tail -n 50 /opt/dvr/var/db/mariadb/localhost.err
Please copy the 50 lines of output here and we'll see if that helps.

Craig
Last login: Mon Sep 19 13:32:05 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo tail -n 50 /opt/dvr/var/db/mariadb/localhost.err
Password:
211231 19:00:28 InnoDB: highest supported file format is Barracuda.
211231 19:00:28 InnoDB: Waiting for the background threads to start
211231 19:00:29 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 1597945
211231 19:00:29 [Note] Server socket created on IP: '::'.
211231 19:00:29 [Note] Event Scheduler: Loaded 0 events
211231 19:00:29 [Note] /opt/dvr/lib/mariadb/bin/mysqld: ready for connections.
Version: '5.5.52-MariaDB' socket: '/opt/dvr/var/run/mariadb/mysqld.sock' port: 3306 Source distribution
220919 9:08:50 [Note] /opt/dvr/lib/mariadb/bin/mysqld: Normal shutdown

220919 9:08:50 [Note] Event Scheduler: Purging the queue. 0 events
220919 9:08:50 InnoDB: Starting shutdown...
220919 9:08:51 InnoDB: Shutdown completed; log sequence number 1597945
220919 9:08:51 [Note] /opt/dvr/lib/mariadb/bin/mysqld: Shutdown complete

220919 9:09:58 InnoDB: The InnoDB memory heap is disabled
220919 9:09:58 InnoDB: Mutexes and rw_locks use GCC atomic builtins
220919 9:09:58 InnoDB: Compressed tables use zlib 1.2.10
220919 9:09:58 InnoDB: Initializing buffer pool, size = 128.0M
220919 9:09:58 InnoDB: Completed initialization of buffer pool
220919 9:09:58 InnoDB: highest supported file format is Barracuda.
220919 9:09:58 InnoDB: Waiting for the background threads to start
220919 9:09:59 Percona XtraDB (http://www.percona.com) 5.5.49-MariaDB-38.0 started; log sequence number 1597945
220919 9:09:59 [Note] Server socket created on IP: '::'.
220919 9:09:59 [Note] Event Scheduler: Loaded 0 events
220919 9:09:59 [Note] /opt/dvr/lib/mariadb/bin/mysqld: ready for connections.
Version: '5.5.52-MariaDB' socket: '/opt/dvr/var/run/mariadb/mysqld.sock' port: 3306 Source distribution
220919 9:12:53 [ERROR] mysqld: Can't lock aria control file '/opt/dvr/var/db/mariadb/aria_log_control' for exclusive use, error: 35. Will retry for 30 seconds
220919 9:13:24 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/opt/dvr/var/db/mariadb/aria_log_control'
220919 9:13:24 [ERROR] Plugin 'Aria' init function returned error.
220919 9:13:24 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
ERROR: 1017 Can't find file: '/var/tmp/#sqle8d_1_3' (errno: 2)
220919 9:13:24 [ERROR] Aborting

220919 9:13:24 [Note] /opt/dvr/lib/mariadb/bin/mysqld: Shutdown complete

220919 9:18:24 [ERROR] mysqld: Can't lock aria control file '/opt/dvr/var/db/mariadb/aria_log_control' for exclusive use, error: 35. Will retry for 30 seconds
220919 9:18:55 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/opt/dvr/var/db/mariadb/aria_log_control'
220919 9:18:55 [ERROR] Plugin 'Aria' init function returned error.
220919 9:18:55 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
220919 9:18:55 [ERROR] mysqld: Table './mysql/db' is marked as crashed and should be repaired
220919 9:18:55 [Warning] Checking table: './mysql/db'
220919 9:18:55 [ERROR] mysql.db: 1 client is using or hasn't closed the table properly
220919 9:18:55 [ERROR] mysqld: Table './mysql/user' is marked as crashed and should be repaired
220919 9:18:55 [Warning] Checking table: './mysql/user'
220919 9:18:55 [ERROR] mysql.user: 1 client is using or hasn't closed the table properly
ERROR: 1017 Can't find file: '/var/tmp/#sql3bfc_1_3' (errno: 2)
220919 9:18:55 [ERROR] Aborting

220919 9:18:55 [Note] /opt/dvr/lib/mariadb/bin/mysqld: Shutdown complete

MacBook-Pro-BigSur:~ jbradleyjansen$
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

Code: Select all

220919 9:12:53 [ERROR] mysqld: Can't lock aria control file '/opt/dvr/var/db/mariadb/aria_log_control' for exclusive use, error: 35. Will retry for 30 seconds
220919 9:13:24 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/opt/dvr/var/db/mariadb/aria_log_control'
I am no database guru but the above seems to be what is stopping the database server.

Please reboot your computer, wait 5+ minutes and check to see if mysqld is running. It is possible that there is an errant lock from the installer or one of the commands you've tried so far. Rebooting might release such a lock.

Failing that, we may need some help. I know Apple has made some changes in system security in the last few releases of the Mac operating system. That could possibly be the reason that this version of MariaDB is unable to start.

Craig
Formerly the MacPorts guy.
BradleyinDC
Junior
Posts: 34
Joined: Fri Sep 16, 2022 6:31 pm
United States of America

Re: MacPorts Install problem

Post by BradleyinDC »

pvr4me wrote:
Tue Sep 20, 2022 12:13 am
Please reboot your computer, wait 5+ minutes and check to see if mysqld is running. It is possible that there is an errant lock from the installer or one of the commands you've tried so far. Rebooting might release such a lock.
Last login: Tue Sep 20 06:32:28 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo -u _mysql mysql_install_db
Password:
Installing MariaDB/MySQL system tables in '/opt/dvr/var/db/mariadb' ...
220920 10:01:14 [Note] /opt/dvr/lib/mariadb/bin/mysqld (mysqld 5.5.52-MariaDB) starting as process 85199 ...

Installation of system tables failed! Examine the logs in
/opt/dvr/var/db/mariadb for more information.

The problem could be conflicting information in an external
my.cnf files. You can ignore these by doing:

shell> /opt/dvr/lib/mariadb/bin/scripts/mysql_install_db --defaults-file=~/.my.cnf

You can also try to start the mysqld daemon with:

shell> /opt/dvr/lib/mariadb/bin/mysqld --skip-grant --general-log &

and use the command line tool /opt/dvr/lib/mariadb/bin/mysql
to connect to the mysql database and look at the grant tables:

shell> /opt/dvr/lib/mariadb/bin/mysql -u root mysql
mysql> show tables;

Try 'mysqld --help' if you have problems with paths. Using
--general-log gives you a log in /opt/dvr/var/db/mariadb that may be helpful.

The latest information about mysql_install_db is available at
https://mariadb.com/kb/en/installing-sy ... install_db
MariaDB is hosted on launchpad; You can find the latest source and
email lists at http://launchpad.net/maria

Please check all of the above before submitting a bug report
at http://mariadb.org/jira

MacBook-Pro-BigSur:~ jbradleyjansen$ chsh -s /bin/zsh
Changing shell for jbradleyjansen.
Password for jbradleyjansen:
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo cp /opt/dvr/share/mythtv/database/my.cnf /opt/dvr/etc/mariadb
Password:
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist
/Library/LaunchDaemons/org.macports.mariadb-server.plist: service already loaded
Load failed: 37: Operation already in progress
MacBook-Pro-BigSur:~ jbradleyjansen$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mariadb-server.plist
/Library/LaunchDaemons/org.macports.mariadb-server.plist: service already loaded
Load failed: 37: Operation already in progress
MacBook-Pro-BigSur:~ jbradleyjansen$
User avatar
pvr4me
Senior
Posts: 763
Joined: Fri Feb 07, 2014 7:25 pm
Location: near Toronto, Canada
Contact:
Canada

Re: MacPorts Install problem

Post by pvr4me »

Does the error log show anything different?

Note that I did not suggest running the Terminal commands again. Until we/someone figures out the problem with

Code: Select all

220919 9:12:53 [ERROR] mysqld: Can't lock aria control file '/opt/dvr/var/db/mariadb/aria_log_control' for exclusive use, error: 35. Will retry for 30 seconds
220919 9:13:24 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/opt/dvr/var/db/mariadb/aria_log_control'
the Terminal commands are not going to work.

Hey unix gurus! How do we test that user "_mysql" has appropriate privileges for '/opt/dvr/var/db/mariadb/aria_log_control' ??

Craig
Formerly the MacPorts guy.
Post Reply