Pentaho

 View Only

 "Not enough rights to object" error

  • Pentaho
  • Kettle
  • Pentaho
  • Pentaho Data Integration PDI
Christie Nguyen's profile image
Christie Nguyen posted 07-28-2019 21:46

Greetings:

I tried to run a sample transformation to load sales data into a database table and it failed with “Not enough rights to object”.  Please see the below screenshot for the details.  Could someone please give me a pointer on how to fix this?

readsalesdataerror


#Pentaho
#Kettle
#PentahoDataIntegrationPDI
Ana Gonzalez's profile image
Ana Gonzalez

This is a Database error, so you'll have to dig in the database to learn what is not working. Depending on the type of database you are trying to perform the operation the solution might differ, but I would began with common database basics.

Usual suspects:

- The message Not enough rights for object "PUBLIC.SALES" suggest that you are connecting to the database with a user that might have privileges to query the table SALES but doesn't have privileges to TRUNCATE the table and/or INSERT into the table.

- So which user is the owner of SALES table?

- Which user you have defined in the Database connection in Pentaho to connect to the database

- Does the user of the DB connector in Pentaho have the proper privileges over the SALES table?

 

One thing that comes to my mind, usual behaviour in Databases (at least in Oracle, the DB I usually work with) suggest that PUBLIC.SALES is a synonym of a table granted to all users (PUBLIC in Oracle refers to all users in the database), usually that synonym comes with only the SELECT privilege (or the DB Administrator will have a fit, even granting a PUBLIC synonym might be a big no-no, depending on the type of data held in the table)

Regards

Christie Nguyen's profile image
Christie Nguyen

Thank you for your response Ana!

I followed the instructions in the tutorial document for "Build Transformations" from this web page:

https://www.hitachivantara.com/en-us/products/big-data-integration-analytics/pentaho-trial-download/evaluation-support.html

How should I fix the access rights so I could perform TRUNCATE and INSERT into the table?

Ana Gonzalez's profile image
Ana Gonzalez

OK

  1. When you created the Database connection as JNDI and tested, did it say that the connection was successful?
  2. Did you executed the SQL to create the table prior to executing the transformation?

Regards

Christie Nguyen's profile image
Christie Nguyen

Yes, I did the test connection and it was successful. 

I executed the SQL to create the table.  As you can see in the log messages in the screenshot above, the table read ops was successful, but when it tried to TRUNCATE the table, it failed with not enough object rights.  

I also tried to remove the TRUNCATE option and ran the transaction again, but it failed the INSERT ops.

Ana Gonzalez's profile image
Ana Gonzalez

Then I can't help you more, I'm not familiar with the H2 database to guide you with what could be wrong. I final check it occurs to me (to see if the table has been correctly created in the H2 database), would be to create another transformation (or add the step in the same transformation, just configuring it would be test enough), selecting the Input step: Input table, that simply goes to a Dummy step, and in the Input table perform a SELECT * FROM sales. If the SELECT executes correctly (it just won't retrieve any data), then you are sure that the table was correctly created.

It could also have something to do with the correct spelling of the table (correct uppercase and lowercase). Some databases are configured to create everything in uppercase, while others allow for upper and lowercases to coexist so Table1 and TABLE1 are different objects. The option to look for the table in the Input/Output step would assure that the correct spelling is used.

Regards

Johan Hammink's profile image
Johan Hammink

The h2 database is a file situated in ..\data-integration\samples\db\sampledb.h2.db. I think you din't have permissions to change that file.