Unable to connect to database with provided credential

Cloudera Manager tests the database connection when you add the Hue service to a cluster. The Test Database Connection does not work for Oracle databases that require service name instead of the Oracle System ID (SID). This could stop you from adding the Hue service to your cluster.

If you encounter the following error while adding the Hue service through Cloudera Manager, then follow the workaround as mentioned in this topic:

Unable to connect to database with provided credential. Able to find the Database server, but not the specified database. Please check if the database name is correct and make sure that the user can access the database.

  1. Install a different database instance, such as MySql temporarily to use with Hue.
    This is referred to as the Hue database.
  2. Add the Hue service from Cloudera Manager and specify the Hue database details that you created in the previous step.
    This will allow you to get past the Add Service wizard and add the Hue service to your cluster.
  3. Modify the Hue instance to use the actual Oracle database as follows:
    1. Navigate to Cloudera Manager > Clusters > Hue service > Configuration > Category > Database.
      The database configuration fields are displayed.
    2. Set up the Oracle database by configuring the following fields:
      1. Select Oracle as the Hue Database Type.
      2. In the Hue Database Hostname field, specify the Fully Qualified Domain Name (FQDN) of the host on which you have installed the Oracle database.
      3. In the Hue Database Port field, specify the port on the host on which the Oracle databse is running. Typically, this value is 1521.
      4. In the Hue Database Username field, specify the username to log in to the Oracle database.
      5. In the Hue Database Password field, specify the database password.
      6. In the Hue Database Name field, specify the name of the Hue database in the following format:
        <HUE_DB_HOST>:1521/<servicename>
    3. Navigate to Cloudera Manager > Clusters > Hue service > Configuration > Category > Advanced and specify the following in the Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini field:
      [desktop]
      [[database]]
      port=0
  4. Click Save Changes.
  5. Restart the Hue service by clicking Actions > Restart.