delphix / dxtoolkit

Scripts that remotely interact with Delphix engine APIs
Apache License 2.0
38 stars 32 forks source link

Error when executing dx_get_db_env command - No DB selected #244

Closed HoracioDos closed 2 months ago

HoracioDos commented 3 months ago

Expected Behavior The command should retrieve all information about the databases.

Actual Behavior When executing the command ./dx_get_db_env -d dpxlab -rdbms oracle --debug 4

I receive the following error message: The command returns the error message: "There is no DB selected to process on dpxlab . Please check filter definitions."

However, there are databases present in Delphix. image image

Execution log attached dx_get_db_env Execution Log.txt

Steps To Reproduce the Problem Run the following command: ./dx_get_db_env -d dpxlab -rdbms oracle

Software Versions:

Operating Systems:

Thanks

pioro commented 3 months ago

Hello,

Could you please run the command with

./dx_get_db_env -d dpxlab -rdbms oracle -debug 3

and at the end zip a folder with name dpxlab_debug which will be created in the dxtoolkit directory and upload it here ?

regards, Marcin

HoracioDos commented 2 months ago

Hello Marcin. I've attached the zip file. Thanks for your help. debug.zip

HoracioDos commented 2 months ago

Hello Marcin. Neal Stack asked me to change the config file as follows:

            "hostname" : "dpxlab",
            "ip_address" : "192.168.XX.XX",
            "username" : "admin",
and
            "hostname" : "sysadmin_dpxlab",
            "ip_address" : "192.168.XX.XX",
            "username" : "sysadmin",

Now ./dx_get_db_env -d dpxlab_admin -rdbms oracle -debug 3 works as expected.

Appliance            Hostname             Database                       Group           Type     SourceDB                       Parent snapshot                     Used [GB]  Status     Enabled    Unique Name                    Parent time                         VDB creation time                   VDB refresh time
-------------------- -------------------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ---------- ---------- ---------- ------------------------------ ----------------------------------- ----------------------------------- -----------------------------------
dpxlab_admin         192.168.XX.XX        ORCLCDB                        Datasets_Prd    CDB                                     N/A                                       2.72 RUNNING    enabled    ORCLCDB                        N/A                                 2024-07-02 10:58:13                 N/A
dpxlab_admin         192.168.XX.XX        ORCLPDB1                       Datasets_Prd    dSource                                 N/A                                       0.30 RUNNING    enabled    N/A                            N/A                                 2024-07-02 10:58:13                 N/A
dpxlab_admin         192.168.XX.XX        VORCLPDB1                      Datasets_Prd    VDB      ORCLPDB1                       2024-07-02 17:36:25 -03                   0.19 RUNNING    enabled    N/A                            2024-07-02 17:36:25 -03             2024-07-02 11:56:51                 2024-07-02 17:37:32

As I told Neal before in the community site, I could have sworn that before it wasn't necessary for the hostname to be different for each user, but it's obvious that I'm wrong. Please tell me if you want me to close this issue.

Thank you very much for your help

pioro commented 2 months ago

Hello

If you tried before with sysadmin credentials you can't see any databases. GUI is forcing 2 different users but in dxtoolkit if you want to have both you need to have a config file as recommended by Neal.

If you are OK with our answers, please close the issue.

HoracioDos commented 2 months ago

Hello, I tried only with admin credentials. I'm aware that it won't work with sysadmin, but it seems that if you have the same name for the hostname in dxtools.conf, it causes this strange behavior. I close this issue. Thanks for your time!

pioro commented 2 months ago

I see - hostname is used a selector of the config to use - if you have duplicates - one will replace another, I am not sure if there is a particular order which one will win - it is up to Perl JSON library