Page 1 of 2

"Forbidden" after installing

Unread postPosted: Sun Feb 02, 2020 10:22 pm
by faroinsua
Hi,
I managed to install it, imported the sql file changing `root`@`localhost` to CURRENT_USER as the root access is reserved to my hoster. Now I get onto the login screen.
I manage to enter with globeadmin and nu but wherever I click now, the answer is "Forbidden, you dont have access to this resource". Will mysql 5.7. be the prblem?
Any ideas? I´m so happy to have found a web based database system.
:)

Re: "Forbidden" after installing

Unread postPosted: Tue Feb 04, 2020 12:43 am
by kev1n
403 Forbidden Error: What It Is and How to Fix It:

https://airbrake.io/blog/http-errors/40 ... dden-error

ALso check the PHP log files.

Re: "Forbidden" after installing

Unread postPosted: Tue Feb 04, 2020 6:28 am
by faroinsua
My problem seems to be that my hoster does not accept any user named "root". I have setup an user with the greatest privileges I can asign and entered the user name and password in the nuconfig.php.
But I still get the "Forbidden" popup when I click on any field inside the nubuilder panel.

Re: "Forbidden" after installing

Unread postPosted: Tue Feb 04, 2020 6:33 am
by kev1n
Have you checked the PHP log file(s)? Maybe you'll see more details what's going wrong.

Re: "Forbidden" after installing

Unread postPosted: Sun Feb 16, 2020 4:09 am
by faroinsua
I managed to install it. All the errors I had got solved when I bought a new hosting, in this case it was arsys.es
create Database
define database user and password
define globeadmin user and password in nuconfig.php
upload all into root and type domain into browser

thanx.

Re: "Forbidden" after installing

Unread postPosted: Wed Nov 25, 2020 5:31 am
by zuppo
I ran into the same problem today. I 'm on a shared hosting with no options to set the permissions of the database-users that I create.
It seems ok now. At least after I unflagged the sql injection detection option on the server and also i the sql-dump of my local database I changed the lines with "CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW" in "CREATE VIEW `zzzzsys_report_data` ...
Fingers crossed ;)
Grz!

Re: "Forbidden" after installing

Unread postPosted: Wed Nov 25, 2020 6:56 am
by admin
Guys,

I would like to fix this problem too but first I need the new SQL file tested.

If you want to test it, you can find a replacement for the problem nubuilder4.sql with this one here...

https://forums.nubuilder.com/viewtopic.php?f=19&t=10652#p22364

Unzip this file and replace the current nubuilder4.sql file and give it a try.


Steven

Re: "Forbidden" after installing

Unread postPosted: Wed Nov 25, 2020 10:00 am
by nac
Hi Steven,

I tried this on two databases. In both cases I created an empty database and logged in using a non-root account with full privileges.

On the local WAMP (MySQL 5.7.11) and on the shared hosting (MySQL 5.6.41-84.1), the creation of views encounters the permission problem. The tables were created OK.

Code: Select all
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `zzzzsys_report_data` AS select concat('PROCEDURE:',`zzzzsys_php`.`zzzzsys_php_id`) AS `id`,`zzzzsys_php`.`sph_code` AS `code`,`zzzzsys_php`.`sph_description` AS `description` from `zzzzsys_php` where `zzzzsys_php`.`sph_system` <> '1' and locate('#TABLE_ID#',`zzzzsys_php`.`sph_php`) > '0' union select concat('SQL:',`zzzzsys_select`.`zzzzsys_select_id`) AS `id`,'nuSQL' AS `code`,`zzzzsys_select`.`sse_description` AS `description` from `zzzzsys_select` where `zzzzsys_select`.`sse_system` is null or `zzzzsys_select`.`sse_system` = '' union select concat('TABLE:',`zzzzsys_table`.`zzzzsys_table_id`) AS `id`,'nuTABLE' AS `code`,`zzzzsys_table`.`zzzzsys_table_id` AS `description` from `zzzzsys_table` */
MySQL said: Documentation

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation


What I have noticed is that, when using Adminer to dump a database script, it does not insert the 'DEFINER= user@server' . This is part of the Adminer SQL dump file.

Code: Select all
DROP TABLE IF EXISTS `zzzzsys_report_data`;
CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `zzzzsys_report_data` AS select concat('PROCEDURE:',`zzzzsys_php`.`zzzzsys_php_id`) AS `id`,`zzzzsys_php`.`sph_code` AS `code`,`zzzzsys_php`.`sph_description` AS `description` from `zzzzsys_php` where ((`zzzzsys_php`.`sph_system` <> '1') and (locate('#TABLE_ID#',`zzzzsys_php`.`sph_php`) > '0')) union select concat('SQL:',`zzzzsys_select`.`zzzzsys_select_id`) AS `id`,'nuSQL' AS `code`,`zzzzsys_select`.`sse_description` AS `description` from `zzzzsys_select` where (isnull(`zzzzsys_select`.`sse_system`) or (`zzzzsys_select`.`sse_system` = '')) union select concat('TABLE:',`zzzzsys_table`.`zzzzsys_table_id`) AS `id`,'nuTABLE' AS `code`,`zzzzsys_table`.`zzzzsys_table_id` AS `description` from `zzzzsys_table`;


It seems that mysqlpump has a --skip-definer option as well. Maybe a solution?

I hope this helps.

Neil

Re: "Forbidden" after installing

Unread postPosted: Wed Nov 25, 2020 3:02 pm
by Janusz
Hi,
Concerning DEFINER and latest test DB from the link.
So in standard nubuilder4.sql (latest or in any other before) DEFINER is not present in the file.
on tested sql from the latest post: the DEFINER is used like: DEFINER=`root`@`localhost`
in my case in nuconfig.php I do not use root so it does not work now and I have an error:
Code: Select all
#1227 - Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
(just for info - it's not a problem specifically for me)

SO the best - in my case - would be NOT to use DEFINER in the initial sql file (I mean to keep current nubuilder4.sql structure)

Historically 2 years ago I was afraid to place root data to the nuconfig.php so I started to use globeadmin instead and I am continuing with it with no issue at all:
Code: Select all
    $nuConfigDBHost                 = "127.0.0.1";
    $nuConfigDBName                 = "nubuilder4";
    $nuConfigDBUser                 = "globeadmin";
    $nuConfigDBPassword             = ".........";
    $nuConfigDBGlobeadminUsername   = "globeadmin";     //-- globeadmin username
    $nuConfigDBGlobeadminPassword   = "..........";             //-- globeadmin password
    $nuConfigTitle                  = "nuBuilder 4";
    $nuConfigIsDemo                 = false;

I use several instances of databases and to make some differences I use different globeadmin names for different DBs like: globeadmin1, globeadmin2, globeadmin3,
(And it prevents as well form mistakes if you switch between them)

AND to be able to import DB form one to the other first in the .sql file I have to modify the globeadmin name for example from globeadmin2 to globeadmin3. Without that I would have:
Code: Select all
#1227 - Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
(on linux the change of the name is not painfull at all - just one simple script with:)
Code: Select all
sed -i 's/globeadmin/globeadmin5/g' /root/temp/TestDBtemp.sql


I was testing in the past similar setup on one commerially predifined server with mysql (no root access) - and in basic cofiguration it was working fine - but some options were blocked like events for example - and thats why it was just test only - (they are not willing to make any deviation from standard - and just told me if you need something different you need to go for VPS)

Additional isssue is usage of phpmyadmin - I had bad experience with importing DB's - at least in the past there was limitation of file of 2MB if I well rememeber. So initially works fine until the files are small but one day you can have big problem not be able to import your backup for example - thats why I switch to standard command line MariaDB utility for import/export.

Re: "Forbidden" after installing

Unread postPosted: Wed Nov 25, 2020 3:49 pm
by admin
Hi Everyone,

The problem has been in the wiki's instructions which have now been changed...

https://forums.nubuilder.com/viewtopic.php?f=19&t=10652&p=22371#p22369


Steven