WebGUI
      Click here to register.
      
irc://irc.freenode.net#webgui

iPhoneGuy: WebGUI is a pile of crap.
rizen: If WebGUI is such a pile of crap, why do you use it?
iPhoneGuy: Because it's the best pile of crap out there.

If this is what people who hate us are saying, imagine what people who love us will say. Come join us on IRC.


     Re: SQLForm - cannot add new asset Goto page «Previous Page   1 2 3    Next Page»

SQLForm - cannot add new asset

User knowmad
Date 12/22/2006 3:25 pm
Severity Critical (mostly not working)
Version WebGUI 7.3.2
Views 1585
Rating 15    Rate [
|
]
Karma Rank 0.000000
Previous · Next
User Message
knowmad

It looks like some of the new logic that was added recently may have lead to some problems. We are no longer able to add SQLForms due to the following error:

Some error(s) occurred:

  • Databaselink does not have enough privileges (Needs ALTER, CREATE, DELETE, INDEX, INSERT, SELECT, UPDATE)

I confirmed the database link user and password was correct. I also confirmed the privileges for this user. The existing SQLForms and SQLReports which use this link appear to be working fine.


William

 



Back to Top
Rate [
|
]
 
 
martink

I put that in there to prevent fatal errors on sqlform addition. Probably it's is a bit of a too strong medicine. Can you please post the results of the following query for the databaselink you use?

 SHOW GRANTS FOR CURRENT_USER(); 



Back to Top
Rate [
|
]
 
 
knowmad

mysql> SHOW GRANTS FOR CURRENT_USER();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for jvgqtvro@localhost                                                                                                                                                                                     |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER, EXECUTE ON *.* TO 'jvgqtvro'@'localhost' IDENTIFIED BY PASSWORD '*E24909AF8D94E418FF1C0F73D1093C4F274E891C'                                           |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `bonterrabuilders\_data`.* TO 'jvgqtvro'@'localhost' |
| GRANT ALL PRIVILEGES ON `bonterrabuilders_com`.* TO 'jvgqtvro'@'localhost'                                                                                                                                        |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.02 sec)

 

As you can see all the grants are there. I did some debugging and the @privileges array was empty after you gathered the grants for the user. Looks like a regex or split error. 



Back to Top
Rate [
|
]
 
 
martink

Two questions: 

1) What DSN do you use?

2) Is the \ in  bonterrabuilders\_data supposed to be there?



Back to Top
Rate [
|
]
 
 
knowmad

Yes, the backslash is coming through, apparently from mysql. Right now, it's showing 2 backslashes when I dump the @grants. I've added lines to the module to dump database name and the @grants list:

Databasename = bonterrabuilders_data

$VAR1 = [
          'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER, EXECUTE ON *.* TO \'jvgqtvro\'@\'localhost\' IDENTIFIED BY PASSWORD \'*E24909AF8D94E418FF1C0F73D1093C4F274E891C\'',
          'GRANT ALL PRIVILEGES ON `bonterrabuilders_com`.* TO \'jvgqtvro\'@\'localhost\'',
          'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `bonterrabuilders\\_data`.* TO \'jvgqtvro\'@\'localhost\''
        ];
 

Here's what I get from the show grant command via mysql cmd-line tool:

mysql> show grants for current_user;
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for jvgqtvro@localhost                                                                                                      |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, ALTER, EXECUTE ON *.* TO 'jvgqtvro'@'localhost' IDENTIFIED BY PASSWORD '*E24909AF8D94E418FF1C0F73D1093C4F274E891C'                                           |
| GRANT ALL PRIVILEGES ON `bonterrabuilders_com`.* TO 'jvgqtvro'@'localhost'                                                                                                      |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `bonterrabuilders\_data`.* TO 'jvgqtvro'@'localhost' |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 

As you can see, somewhere in the dbLink->db->buildArray methods, special chars are getting backslashed which is causing the backslash that mysql adds to get backslashed again. Is there a way we can tell the dbLink calls not to add more backslashes. We can add a backslash to the db name via following:

   $databaseName =~ s/_/\\_/g;

 

William 



Back to Top
Rate [
|
]
 
 
martink
I figured out what the bug was. Apparently there are a gazillion ways to construct dsn's. I committed a fix in 7.3.4 that should take this in account. If it still doesn't work, please reopen and post the dsn you use in the databaselink.


Back to Top
Rate [
|
]
 
 
knowmad
Thanks Martin. Sorry I didn't get back to you earlier but glad to hear you got it figured out. We'll test it when 7.3.4 gets released.

Back to Top
Rate [
|
]
 
 
TheSeparator

I experience this bug still in 7.3.8

Was this supposed to be solved ?

Regards,

TheSeparator

 



Back to Top
Rate [
|
]
 
 
colink

Can you please post your DSN?

Without it we have no way to fix the bug.

 



Back to Top
Rate [
|
]
 
 
TheSeparator

Hi,

This is the dsn used:

DBI:mysql:MyTestBase:localhost

 

Hope this helps,

Regards,

TheSeparator

 



Back to Top
Rate [
|
]
 
 
     Re: SQLForm - cannot add new asset Goto page «Previous Page   1 2 3    Next Page»