OJS 3.0.2 and PHP 7.1.3 - Error "The current role does not have access to this operation" first login

Hi,
I have just installed OJS 3.0.2 at Heroku cloud service. However, when I login using the admin account I set during the configuration the system show me a pop up with the message “The current role does not have access to this operation” and in the sequence “Access denied”.

I have installed the OJS in MySQL and Postgres, but in both I receive the same error. I tried to setup the PHP configuration as suggested in another post, but I was not successful.

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

The logs do not show any error, but they indicate several Warnings and Deprecarted functions, which I do not know if it is the cause of the problem.

2017-06-13T13:30:12.554000+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of PageHandler::authorize($request, &$args, $roleAssignments) should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /app/web/lib/pkp/controllers/page/PageHandler.inc.php on line 19

2017-06-13T13:30:12.586508+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Deprecated: Non-static method Request::getContext() should not be called statically in /app/web/lib/pkp/classes/plugins/ThemePlugin.inc.php on line 409

2017-06-13T13:30:12.586708+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Deprecated: Non-static method PKPRequest::_checkThis() should not be called statically in /app/web/classes/core/Request.inc.php on line 68

2017-06-13T13:30:12.767135+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::getDataElementSequence($gridDataElement) should be compatible with GridHandler::getDataElementSequence(&$gridDataElement) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.767445+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::setDataElementSequence($request, $rowId, $context, $newSequence) should be compatible with GridHandler::setDataElementSequence($request, $rowId, &$gridDataElement, $newSequence) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.767755+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::authorize($request, &$args, $roleAssignments) should be compatible with GridHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.768044+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::initialize($request) should be compatible with GridHandler::initialize($request, $args = NULL) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.768271+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::loadData($request) should be compatible with GridHandler::loadData($request, $filter) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.768533+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextGridHandler::initFeatures($request, $args) should be compatible with GridHandler::initFeatures($request, &$args) in /app/web/lib/pkp/controllers/grid/admin/context/ContextGridHandler.inc.php on line 0

2017-06-13T13:30:12.769018+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ValidatorUrl::getRegexp() should be compatible with ValidatorUri::getRegexp($allowedSchemes = NULL) in /app/web/lib/pkp/classes/validation/ValidatorUrl.inc.php on line 19

2017-06-13T13:30:12.769332+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of ContextSiteSettingsForm::fetch($args, $request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /app/web/lib/pkp/controllers/grid/admin/context/form/ContextSiteSettingsForm.inc.php on line 19

2017-06-13T13:30:12.769607+00:00 app[web.1]: [13-Jun-2017 15:30:12 Europe/Berlin] PHP Warning: Declaration of JournalSiteSettingsForm::execute($request) should be compatible with Form::execute($object = NULL) in /app/web/controllers/grid/admin/journal/form/JournalSiteSettingsForm.inc.php on line 18

Is there any debugging feature I can enable at OJS to track this problem down?

Thank you in advance,

Hi,
I could manage to install OJS 3.0.2 at Heroku Cloud Service server after

  1. using PHP 5.6 instead of PHP 7.1
  2. using Postgre instead of MySQL database
  3. setting session_check_ip = Off in the config.inc.php file

Because Heroku requires all configuration changes to be done at build time I had to use the buldpack-run (lalitkapoor/heroku-buildpack-run - Buildpacks - Heroku Elements) to run commands in the build process to execute the OJS installation.

The composer.json I used was
{
“require”: {
“php”: “^5.6.0”
},
“require-dev”: {
“heroku/heroku-buildpack-php”: “*”
},
“scripts”: {
“compile”: [
“chmod 777 web/config.inc.php”,
“chmod -R 777 web/cache/t_cache/”,
“chmod -R 777 web/cache/t_compile/”,
“chmod -R 777 web/cache/t_config/”,
“chmod -R 777 web/cache/_db/”,
“chmod -R 777 web/public/”,
“chmod -R 777 web/submissions/”
]
}
}

and the script to install OJS was

#/bin/bash

cd web/lib/pkp
curl -sS https://getcomposer.org/installer | php
php composer.phar update

cd …/…/…
php -S localhost:9000 &
server=$!

sleep 10

wget -O - -q --post-data="adminUsername=admin&adminPassword=admin&adminPassword2=admin&adminEmail=email@email.com&locale=en_US&additionalLocales[]=en_US&clientCharset=utf-8&connectionCharset=utf8&databaseCharset=utf8&filesDir=submissions&encryption=sha1&databaseDriver=postgres&databaseHost=host&databaseUsername=username&databasePassword=password&databaseName=databasename&oaiRepositoryId=ojs2.xxxxx.herokuapp.com" “http://localhost:9000/web/index.php/index/install/install” > logs.txt

kill -9 $server

Hi @gnardin,

Thanks for the follow-up – were you able to track down details on any of these quirks? OJS should work fine with MySQL, for example, and PHP 7.1.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I could install OJS in PHP 7.1 and MySQL in a local machine, but not in Heroku Cloud Service.

I could not track down the issues because I am in a special environment, Heroku Cloud Service, that imposes many restrictions on how to install OJS. For instance, I can change configuration files just when deploying and installing OJS, afterwards I am not able to change any configuration file by logging in unless I redeploy and reinstall all the system again.

Best,
Gustavo