You do not have access to the requested area/action.

Hi,

When trying to modify forms (add action or field) i receive JavaScript message: You do not have access to the requested area/action. The same happens in Campaign builder, didn’t check a lot but Lists work well.



Nginx shows no errors

Browser console shows no errors



I have admin rights (first and only user)



Any ideas?



Using 1.2.3, downloaded today

Hi,
When trying to modify forms (add action or field) i receive JavaScript message: You do not have access to the requested area/action. The same happens in Campaign builder, didn’t check a lot but Lists work well.

Nginx shows no errors
Browser console shows no errors

I have admin rights (first and only user)

Any ideas?

Using 1.2.3, downloaded today

1.2.2 - problem is the same

There is no log file in app/logs

I had mautic installed before on the same server with the same settings. Before reinstall it was working like a charm.

This is nginx access log:

[28/Dec/2015:01:23:11 +0100] "GET /s/forms/field/new?type=captcha&tmpl=field&formId=1&_=1451262181604&mauticUserLastActive=1&mauticLastNotificationId=3 HTTP/1.1" 200 76 "http://mautic.dimmi.pl/s/forms/edit/1" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/537.86.3"

I’ve got some errors in mautic logs now:

[2015-12-25 02:03:15] mautic.WARNING: Command `doctrine:migrations:version` exited with status code 255 [] [] [2015-12-25 02:03:15] mautic.ERROR: PDOException: SQLSTATE[28000] [1045] Access denied for user 'www-data'@'localhost' (using password: NO) (uncaught exception) at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 40 while running console command `doctrine:migrations:version` [] [] [2015-12-25 10:31:33] mautic.WARNING: IP LOOKUP: The file "/home/dimmi/mautic/app/cache/prod/../ip_data/GeoLite2-City.mmdb" does not exist or is not readable. [] [] [2015-12-25 10:31:33] mautic.WARNING: IP LOOKUP: The file "/home/dimmi/mautic/app/cache/prod/../ip_data/GeoLite2-City.mmdb" does not exist or is not readable. [] [] [2015-12-25 10:31:33] mautic.WARNING: IP LOOKUP: The file "/home/dimmi/mautic/app/cache/prod/../ip_data/GeoLite2-City.mmdb" does not exist or is not readable. [] []

This URL: http://mautic.dimmi.pl/s/forms/field/new?type=captcha&tmpl=field&formId=1&_=1451262181604&mauticUserLastActive=1&mauticLastNotificationId=3

Returns:

{"error":"You do not have access to the requested area/action."}

I guess this is the reason:

[2015-12-25 02:03:15] mautic.WARNING: Command `doctrine:migrations:version` exited with status code 255 [] []

When applying database credentials at installer, first time it just reloads and I have to put them again to work. www-data with no password are not these credentials, maybe it’s sending empty form at first?

I reinstalled from source - master branch, release 1.2.3, packages installed by composer. Same thing again.

This is in the logs now:

[code][2015-12-28 01:06:55] mautic.CRITICAL: Uncaught PHP Exception DoctrineDBALDBALException: “An exception occurred while executing ‘SELECT u0_.is_published AS is_published0, u0_.date_added AS date_added1, u0_.created_by AS created_by2, u0_.created_by_user AS created_by_user3, u0_.date_modified AS date_modified4, u0_.modified_by AS modified_by5, u0_.modified_by_user AS modified_by_user6, u0_.checked_out AS checked_out7, u0_.checked_out_by AS checked_out_by8, u0_.checked_out_by_user AS checked_out_by_user9, u0_.id AS id10, u0_.username AS username11, u0_.password AS password12, u0_.first_name AS first_name13, u0_.last_name AS last_name14, u0_.email AS email15, u0_.position AS position16, u0_.timezone AS timezone17, u0_.locale AS locale18, u0_.last_login AS last_login19, u0_.last_active AS last_active20, u0_.online_status AS online_status21, u0_.preferences AS preferences22, r1_.is_published AS is_published23, r1_.date_added AS date_added24, r1_.created_by AS created_by25, r1_.created_by_user AS created_by_user26, r1_.date_modified AS date_modified27, r1_.modified_by AS modified_by28, r1_.modified_by_user AS modified_by_user29, r1_.checked_out AS checked_out30, r1_.checked_out_by AS checked_out_by31, r1_.checked_out_by_user AS checked_out_by_user32, r1_.id AS id33, r1_.name AS name34, r1_.description AS description35, r1_.is_admin AS is_admin36, r1_.readable_permissions AS readable_permissions37, u0_.role_id AS role_id38 FROM users u0_ LEFT JOIN roles r1_ ON u0_.role_id = r1_.id WHERE u0_.username = ? OR u0_.email = ?’ with params [“patryk”, “patryk”]: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected” at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 {“exception”:"[object] (Doctrine\DBAL\DBALException(code: 0): An exception occurred while executing ‘SELECT u0_.is_published AS is_published0, u0_.date_added AS date_added1, u0_.created_by AS created_by2, u0_.created_by_user AS created_by_user3, u0_.date_modified AS date_modified4, u0_.modified_by AS modified_by5, u0_.modified_by_user AS modified_by_user6, u0_.checked_out AS checked_out7, u0_.checked_out_by AS checked_out_by8, u0_.checked_out_by_user AS checked_out_by_user9, u0_.id AS id10, u0_.username AS username11, u0_.password AS password12, u0_.first_name AS first_name13, u0_.last_name AS last_name14, u0_.email AS email15, u0_.position AS position16, u0_.timezone AS timezone17, u0_.locale AS locale18, u0_.last_login AS last_login19, u0_.last_active AS last_active20, u0_.online_status AS online_status21, u0_.preferences AS preferences22, r1_.is_published AS is_published23, r1_.date_added AS date_added24, r1_.created_by AS created_by25, r1_.created_by_user AS created_by_user26, r1_.date_modified AS date_modified27, r1_.modified_by AS modified_by28, r1_.modified_by_user AS modified_by_user29, r1_.checked_out AS checked_out30, r1_.checked_out_by AS checked_out_by31, r1_.checked_out_by_user AS checked_out_by_user32, r1_.id AS id33, r1_.name AS name34, r1_.description AS description35, r1_.is_admin AS is_admin36, r1_.readable_permissions AS readable_permissions37, u0_.role_id AS role_id38 FROM users u0_ LEFT JOIN roles r1_ ON u0_.role_id = r1_.id WHERE u0_.username = ? OR u0_.email = ?’ with params [“patryk”, “patryk”]:nnSQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:91, PDOException(code: 3D000): SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:694)"} []
[2015-12-28 01:08:09] mautic.ERROR: DoctrineDBALDBALException: An exception occurred while executing ‘SHOW FULL TABLES WHERE Table_type = ‘BASE TABLE’’: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (uncaught exception) at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 while running console command doctrine:migrations:version [] []

[/code]

I think the problem is in

mautic.ERROR: PDOException: SQLSTATE[28000] [1045] Access denied for user 'www-data'@'localhost'

and

No database selected

But I have no explanation for why Mautic works in some areas and does not in others. Maybe try to clear the cache (remove the app/cache folder)

Clearing cache did not help.

According to logs, Mautic is trying to log into database with empty credentials in installer form and it fall backs to default nginx user ‘www-data’ with no password and no database selected.

Is there any way I can write database credentials manually in some config file and run database migrations by myself?

This is Mautic error log when setting root credentials to mysql database:

[2015-12-29 22:50:06] mautic.ERROR: DoctrineDBALDBALException: An exception occurred while executing 'SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'':  SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (uncaught exception) at /home/dimmi/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 while running console command `doctrine:migrations:version` [] []

I have this problem too in campaign builder.

I check mautic error log and it says “$HTTP_RAW_POST_DATA is deprecated”.
I set always_populate_raw_post_data to -1 and also remove cache folder.
But the error still exists.

Do you have another solutions?

The installation process writes the database credentials to app/config/local.php file. Take a look there. Also, clear cache every time you modify a config file so Mautic knows about the change.

@dulabs Your error is not related to the error described in this thread. It would be better to create a new one.

Anyway, have you restarted the server after the PHP configuration change?

Hi,

I managed to solve my problem. During install I disabled SSL connection (I’m using let’s encrypt certificate) and turned it back on when finished install.

Forms and Leads seem to work now.

Thanks for help.