### Installation Error code: nopermissions

Installation Error code: nopermissions

When I try to install moodle I get this error back, can you help me?
Thanks

Sorry, but you do not currently have permissions to do that (Manage models)

It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation.

Debug info:
Error code: nopermissions
Stack trace:
• line 808 of /lib/accesslib.php: required_capability_exception thrown
• line 60 of /analytics/classes/manager.php: call to require_capability()
• line 342 of /analytics/classes/model.php: call to core_analytics\manager::check_can_manage_models()
• line 486 of /analytics/classes/manager.php: call to core_analytics\model::create()
• line 324 of /lib/db/install.php: call to core_analytics\manager::add_builtin_models()
• line 1728 of /lib/upgradelib.php: call to xmldb_main_install()
• line 276 of /admin/index.php: call to install_core()

Average of ratings: -
Re: Installation Error code: nopermissions

Average of ratings: -
Re: Installation Error code: nopermissions

What version of Moodle?  found in moodlecode/version.php

You might have acquired the 3.5DEV version ... that might have had such a bug.

So whatever process you are using to install and on whatever platform, suggest getting the lastest 3.5 code that's NOT dev.

Then try the install again.

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

Hi Ken,

The version is 3.5 (Build: 20180517) but i have tried also 3.4.3 (Build: 20180517) with same result.

Average of ratings: -
Re: Installation Error code: nopermissions

Well, just upgraded a 3.4. to the highest 3.4.3 and installed a fresh 3.5 just today.

No issues.

What are the ownerships/permissions on the data directory you are using for the installs?

What is contained in either moodledata directory for your 3.4 and/or 3.5

Here's what is in a 34 data directory related to models ...

[root@sos moodle34data]# ls -lR models
models:
total 0
drwxrwsrwx. 3 apache apache 24 Nov 18 10:02 2

models/2:
total 0
drwxrwsrwx. 3 apache apache 23 Nov 18 10:02 1510957951

models/2/1510957951:
total 0
drwxrwsrwx. 2 apache apache 6 Nov 18 10:02 execution

models/2/1510957951/execution:
total 0

Like the error says, when an install fails like it did, it is usually not possible to recover and one should drop the database - re-create a new one, and try the install again.

It's a strange error considering there are no users except guest until one installs the first account ... the admin account.

It also might help to share what platform you are running, PHP version, MySQL version, etc., etc.

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

OK, I have a bit of trouble with English but I try:

• Php 7.2
• MySQL 5.7.21
• Moodle 3.5 (Build: 20180517)

I created a third level subdomain http://lab.karnhack.com and this is where I want to install moodle.
The physical path is /home/mhd-01/www.karnhack.com/htdocs/lab
As indicated by my provider (tophost) the subdomain works by inserting in the .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} lab.karnhack.com
RewriteCond %{REQUEST_URI} !lab/
RewriteRule ^(.*)$/lab/$1 [L]

My Step:

1. Upload all the contents of the moodle folder on the ftp space (without the Moodle folder, but with all of its contents).
2. I create the new MySQL database (I can only access the SQL commands). Database name, Username and Password are supplied in automatic (host sql.karnhack.com).
3. Change the character encoding using sql commands in utf8mb4_unicode_ci
4. I go to http://lab.karnhack.com to proceed with the installation
5. I immediately get strange results:

Web address: why http://lab.karnhack.com/lab  ??  It would be correct http://lab.karnhack.com or http://www.karnhack.com/lab but not subdomain+folder.
Moodle Folder: It seems ok but...
Data folder: inexplicably the path /home/mhd-01/www.karnhack.com/moodledata don't work.  The correct path is /home/mhd-01/www.karnhack.com//htdocs/moodledata (with the double // It's weird but it works because I found files inside after trying to install moodle)
6. I proceed forward. All minimum requirements are ok. Only thing not satisfied is the https but it does not seem to be a fundamental requirement.
7. Proceeding forward, a page appears where all the plugins seem to be installed. (I attach a picture of youtube)

In my case the "continue" key never appears. The process seems to stop...
8. Since the configurator in my case does not work I decide to configure the file config.php manually
9. I enter this configuration:

10. I can proceed with the installation but I get this:

That's all. Thanks for your help.

Average of ratings: -
Re: Installation Error code: nopermissions

Looks like the installation attempt didn't really complete creating tables ....

Your screen shot showing core plugin installs is short

Missing these tables

| mdl_workshopform_accumulative    |
| mdl_workshopform_numerrors       |
| mdl_workshopform_numerrors_map   |
| mdl_workshopform_rubric          |
| mdl_workshopform_rubric_config   |
| mdl_workshopform_rubric_levels

which are present in a successfully installed and running 3.5.

The one thing I see in the manual config.php file is
dbport is blank .... db server is sql.karnhack.com
If running MySQL would think the default port for MySQL is 3306
but your setup/provider might have that on something else.

Also, DB servers run faster without looking up clients attempting to access it via DNS.  Many DB admins setup the DB server with skip-networking ... no DNS lookups.  So find out the IP address of sql.karnhack.com ... might be a private IP ...
and use the IP address instead of FQDN.  Might need to check with hosting provider.

A failed lookup in DNS during a process like installation might result in some strange errors/issues.

After replacing the FQDN with IP, also change the prefix to somehing like mdl2_.   This way you do not need to create a new DB.

Then try it again.

Total guess ... don't host where you host and do know not all hosting providers do things the same way!!!! :\

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

I entered the ip address and the port but it gives me the same error:

Config.php:

<?php

///////////////////////////////////////////////////////////////////////////

//                                                                       //

// Moodle configuration file                                             //

//                                                                       //

// This file should be renamed "config.php" in the top-level directory   //

//                                                                       //

///////////////////////////////////////////////////////////////////////////

//                                                                       //

//                                                                       //

// Moodle - Modular Object-Oriented Dynamic Learning Environment         //

//                                                                       //

// Copyright (C) 1999 onwards  Martin Dougiamas  http://moodle.com       //

//                                                                       //

// This program is free software; you can redistribute it and/or modify  //

// the Free Software Foundation; either version 3 of the License, or     //

// (at your option) any later version.                                   //

//                                                                       //

// This program is distributed in the hope that it will be useful,       //

// but WITHOUT ANY WARRANTY; without even the implied warranty of        //

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         //

// GNU General Public License for more details:                          //

//                                                                       //

//                                                                       //

///////////////////////////////////////////////////////////////////////////

unset($CFG); // Ignore this line global$CFG;  // This is necessary here for PHPUnit execution

$CFG = new stdClass(); //========================================================================= // 1. DATABASE SETUP //========================================================================= // First, you need to configure the database where all Moodle data // // will be stored. This database must already have been created // // and a username/password created to access it. //$CFG->dbtype    = 'mysqli';      // 'pgsql', 'mariadb', 'mysqli', 'mssql', 'sqlsrv' or 'oci'

$CFG->dblibrary = 'native'; // 'native' only at the moment$CFG->dbhost    = '000.00.000.000';  // eg 'localhost' or 'db.isp.com' or IP

$CFG->dbname = 'namedb'; // database name, eg moodle$CFG->dbuser    = 'userdb';   // your database username

$CFG->dbpass = 'passdb'; // your database password$CFG->prefix    = 'mdl_';       // prefix to use for all table names

$CFG->dboptions = array( 'dbpersist' => false, // should persistent database connections be // used? set to 'false' for the most stable // setting, 'true' can improve performance // sometimes 'dbsocket' => false, // should connection via UNIX socket be used? // if you set it to 'true' or custom path // here set dbhost to 'localhost', // (please note mysql is always using socket // if dbhost is 'localhost' - if you need // local port connection use '127.0.0.1') 'dbport' => '3306', // the TCP port number to use when connecting // to the server. keep empty string for the // default port 'dbhandlesoptions' => false,// On PostgreSQL poolers like pgbouncer don't // support advanced options on connection. // If you set those in the database then // the advanced settings will not be sent. 'dbcollation' => 'utf8mb4_unicode_ci', // MySQL has partial and full UTF-8 // support. If you wish to use partial UTF-8 // (three bytes) then set this option to // 'utf8_unicode_ci', otherwise this option // can be removed for MySQL (by default it will // use 'utf8mb4_unicode_ci'. This option should // be removed for all other databases. ); //========================================================================= // 2. WEB SITE LOCATION //========================================================================= // Now you need to tell Moodle where it is located. Specify the full // web address to where moodle has been installed. If your web site // is accessible via multiple URLs then choose the most natural one // that your students would use. Do not include a trailing slash // // If you need both intranet and Internet access please read$CFG->wwwroot   = 'http://lab.karnhack.com';

//=========================================================================

// 3. DATA FILES LOCATION

//=========================================================================

// Now you need a place where Moodle can save uploaded files.  This

// directory should be readable AND WRITEABLE by the web server user

// (usually 'nobody' or 'apache'), but it should not be accessible

// directly via the web.

//

// - On hosting systems you might need to make sure that your "group" has

//   no permissions at all, but that "others" have full permissions.

//

// - On Windows systems you might specify something like 'c:\moodledata'

$CFG->dataroot = '/home/mhd-01/www.karnhack.com//htdocs/moodledata'; //========================================================================= // 4. DATA FILES PERMISSIONS //========================================================================= // The following parameter sets the permissions of new directories // created by Moodle within the data directory. The format is in // octal format (as used by the Unix utility chmod, for example). // The default is usually OK, but you may want to change it to 0750 // if you are concerned about world-access to the files (you will need // to make sure the web server process (eg Apache) can access the files. // NOTE: the prefixed 0 is important, and don't use quotes.$CFG->directorypermissions = 0777;

//=========================================================================

// 5. DIRECTORY LOCATION  (most people can just ignore this setting)

//=========================================================================

// A very few webhosts use /admin as a special URL for you to access a

// control panel or something.  Unfortunately this conflicts with the

// standard location for the Moodle admin pages.  You can work around this

// by renaming the admin directory in your installation, and putting that

// After any change you need to visit your new admin directory

// and purge all caches.

.......

.......

require_once(__DIR__ . '/lib/setup.php'); // Do not edit

// There is no php closing tag in this file,

// it is intentional because it prevents trailing whitespace problems!

Average of ratings: -
Re: Installation Error code: nopermissions

I managed to install Moodle with your help. The only problem is that it does not seem to have a style... It's normal or something went wrong? Thanks

Average of ratings: -
Re: Installation Error code: nopermissions

First, please share how you got around the error you were getting ... others (including myself) would be interested.

And it's ok to admit some omission/boo-boo ... done that so many times that I know more about what not to do than to do the first time. ;)

Congrats!  Pat yourself on your back!

Yes, theme is messed up ... others reporting similar issues .... and there may not be the same fix - factors still involved.

But, that's the default theme ... login, go to themes and select another theme ... there's more and clean if I re-call at the moment ... let's see if the site looks like it should that way.   You will see a button to purge theme cache ... do that for sure.

I would turn on or allow the use of multiple themes ... at category level and at course level ... for now ... until things settle in/down.

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

Thanks! I have select the "Clean" Theme and now it's ok!
I have solved with Server IP (numeric) and Port as you advised me. But I had to do it as a configurator, eliminating config.php and following the instructions.

Average of ratings: -
Re: Installation Error code: nopermissions

Still though, that was a very strange error ... not that I've seen all the errors possible, mind ya.

So if you created a 'theme test' category and one course allowed to change themes, and then changed the theme of that course to the 'default' theme, would you get the same error?  Might turn on debugging when you do as suggested ... that's if you have time.   Might be worth reporting.

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

Give me some time to get familiar with moodle. I am available to make the favor!
I have a question. The moodledata folder is safe with chmod 777 and .htacces with

deny from all
AllowOverride None

Thanks

Average of ratings: -
Re: Installation Error code: nopermissions
Time to refer to official Moodle docs:
https://docs.moodle.org/35/en/Security_recommendations

Reason for the .htaccess file already in place due to those who host on a service where they cannot put moodledata outside of document root.    In your case, that might be true so leave the .htaccess file.

'spirit of sharing', Ken

Average of ratings: -
Re: Installation Error code: nopermissions

Ken Task if you explain to me how to do it, I can give you a try

Average of ratings: -
Re: Installation Error code: nopermissions

I created a "themetest" category, a course themetest/coursetematest and i have assigned  it the "boost" theme.

This is "themetest" category:

coursethemetest with "boost" theme

The debug is active but not work on "boost" theme

Average of ratings: -
Re: Installation Error code: nopermissions

First ... https://docs.moodle.org/dev/Themes you'll find User Docs and FAQ's.

Doesn't look like it's rendering like it should so don't use it - anywhere ... until resolved.  Resolution might be in FAQ's.

Am a minimalist when it comes to appearance ... more into function than form.

'spirit of sharing', Ken

Average of ratings: -