Install with cli failed role_capabilities table does not exist

Install with cli failed role_capabilities table does not exist

by Bad Player -
Number of replies: 7
I'm installing Moodle_403_stable on a debian 12 machine. It has 512MB ram and 10gb disk.
It's running LaMP with php 8.2

I'm running the /admin/cli install.php, it starts well but at one point it gives the following error :

root@debian:/home/user/moodle/admin/cli# /usr/bin/php install.php

.....
-->mod_imscp
++ install.php: Success (1.85 seconds) ++
++ update_capabilities: Success (1.69 seconds) ++
++ Success (4.94 seconds) ++
-->mod_label
++ update_capabilities: Success (1.92 seconds) ++
++ Success (3.25 seconds) ++
-->mod_lesson
++ update_capabilities: Success (6.97 seconds) ++
++ external_update_descriptions: Success (2.97 seconds) ++
++ Success (12.58 seconds) ++
-->mod_lti
++ install.php: Success (2.49 seconds) ++
++ update_capabilities: Success (7.01 seconds) ++
++ external_update_descriptions: Success (4.39 seconds) ++
++ Success (17.76 seconds) ++
-->mod_page
++ install.php: Success (1.88 seconds) ++
++ update_capabilities: Success (2.66 seconds) ++
++ Success (8.85 seconds) ++
-->mod_quiz
++ install.xml: Success (1.41 seconds) ++
Default exception handler: Table "role_capabilities" does not exist Debug:
Error code: ddltablenotexist
* line 1512 of /lib/dml/mysqli_native_moodle_database.php: dml_exception thrown
* line 1446 of /lib/accesslib.php: call to mysqli_native_moodle_database->insert_record()
* line 1208 of /lib/accesslib.php: call to assign_capability()
* line 2422 of /lib/accesslib.php: call to assign_legacy_capabilities()
* line 657 of /lib/upgradelib.php: call to update_capabilities()
* line 942 of /lib/upgradelib.php: call to upgrade_component_updated()
* line 696 of /lib/upgradelib.php: call to upgrade_plugins_modules()
* line 1983 of /lib/upgradelib.php: call to upgrade_plugins()
* line 494 of /lib/installlib.php: call to upgrade_noncore()
* line 847 of /admin/cli/install.php: call to install_cli_database()

!!! Table "role_capabilities" does not exist !!!
!!
Error code: ddltablenotexist !!
!! Stack trace: * line 1512 of /lib/dml/mysqli_native_moodle_database.php: dml_exception thrown
* line 1446 of /lib/accesslib.php: call to mysqli_native_moodle_database->insert_record()
* line 1208 of /lib/accesslib.php: call to assign_capability()
* line 2422 of /lib/accesslib.php: call to assign_legacy_capabilities()
* line 657 of /lib/upgradelib.php: call to update_capabilities()
* line 942 of /lib/upgradelib.php: call to upgrade_component_updated()
* line 696 of /lib/upgradelib.php: call to upgrade_plugins_modules()
* line 1983 of /lib/upgradelib.php: call to upgrade_plugins()
* line 494 of /lib/installlib.php: call to upgrade_noncore()
* line 847 of /admin/cli/install.php: call to install_cli_database()
 !!
Exception ignored in shutdown function upgrade_finished_handler: Table "config" does not exist


Any help would be appreciated
Average of ratings: -
In reply to Bad Player

Re: Install with cli failed role_capabilities table does not exist

by Bad Player -
I deleted the moodle database, and the /admin/config.php file and tried again.
Now I get the error much earlier : 
```
Have you read these conditions and understood them?type y (means yes) or n (means no): y
-------------------------------------------------------------------------------
== Setting up database ==
-->System
++ install.xml: Success (2.80 seconds) ++
++ xmldb_main_install: Success (3.68 seconds) ++
Default exception handler: Error reading from database Debug: MySQL server has gone away
SELECT name,value FROM mdl_config_plugins WHERE plugin = ?
[array (
0 => 'format_weeks',
)]
Error code: dmlreadexception
* line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
....
* line 847 of /admin/cli/install.php: call to install_cli_database()

!!! Error reading from database !!!
!! MySQL server has gone away
SELECT name,value FROM mdl_config_plugins WHERE plugin = ?
[array (
0 => 'format_weeks',
)]
Error code: dmlreadexception !!
!! Stack trace: * line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
.....
Exception ignored in shutdown function upgrade_finished_handler: Table "config" does not exist
```


it's as if my mariadb/mysql server crashes. If i try to connect to the db after the moodle error I get : ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (111)
and I need to run systemctl restart mysqld first for it to run.

for context, to solve the MySQL server has gone away error,
I have created file /etc/mysql/mariadb.conf.d/moodle.cnf
```[mysqld]
wait_timeout = 28800
max_allowed_packet = 64M```

But it did not solve the issue.
In reply to Bad Player

Re: Install with cli failed role_capabilities table does not exist

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Looks like the installation wasn't complete. For example ran out of memory. Try installing in the CLI, it needs less resources. See Administration via command line.
In reply to Visvanath Ratnaweera

Re: Install with cli failed role_capabilities table does not exist

by Bad Player -
Hi, thanks for your reply. However this is already using the cli
In reply to Bad Player

Re: Install with cli failed role_capabilities table does not exist

by Ken Task -
Picture of Particularly helpful Moodlers
In reply to Ken Task

Re: Install with cli failed role_capabilities table does not exist

by Bad Player -
Thank you for reply, but I've already set max_input_vars to 6000 in both my webserver php.ini and the the php cli php.ini

(with php 8 the installation script doesn't start if you don't set it to 5000 first)
In reply to Bad Player

Re: Install with cli failed role_capabilities table does not exist

by Ken Task -
Picture of Particularly helpful Moodlers
"512MB ram" ... IMO, that's not enough!
Is machine (not server class hardware) configured to use SWAP space - how much SWAP space?

Even if you manage to get it installed, can predict it will be slow ... very slow at times ... and one will feel a 'time warp' and experience the old dialup days 'world wide wait'! sad

BTW, I don't care what docs (official nor not) you have read ... can't get blood out of turnip and can't put a square peg into a round hole ... period!

My 2 'sense' - nope spelled it correctly!
'SoS', Ken


In reply to Ken Task

Re: Install with cli failed role_capabilities table does not exist

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Moodle 4.1 LTS runs on a Raspberry Pi Zero with 512 MB, if you take the 32 bit OS. But then that will be the final, Moodle 4.2 upwards need 64 bit.