Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can't Delete Saved Queries

Highlighted

Can't Delete Saved Queries

I used the RestAPI to create a bunch of saved queries. Right now I cannot delete either the queries created via the API or new queries I save from the GUI.

When clicking the "x" to delete the query, I'm prompted "Do you want to delete the saved query?" and I click confirm. The popup closes, but the query remains in the list. I've also refreshed the page to make sure it wasn't just a display problem.

Has this behavior been seen before? Are there log files I should watch to find out where the process is failing? I'm not getting any error messages in the GUI.

7 REPLIES 7
Highlighted

Re: Can't Delete Saved Queries

Super Mentor

@Daniel Thomas

It might be a browser cache issue . Can you please try with "Incognito Mode" (Private Mode") of your browser to see if Browser Caching is not causing any issue. If you are using IE browser then it might be related to that.


As an alternate approach, Can you please try this:


1). Try to get the list of savedQueryes to find out the saved query ID that you want to delete

# curl -H "X-Requested-By: ambari" -u admin:admin -X GET http://localhost:8080/api/v1/views/HIVE/versions/2.0.0/instances/AUTO_HIVE20_INSTANCE/savedQueries


2). Then try deleting that query id as following (say query id is "51" )

# curl -H "X-Requested-By: ambari" -u admin:admin -X DELETE http://localhost:8080/api/v1/views/HIVE/versions/2.0.0/instances/AUTO_HIVE20_INSTANCE/savedQueries/5...

.

If the API calls also fails to delete the SavedQuery then definitely some error will be logged inside the "ambari-server.log" please share the log.

Highlighted

Re: Can't Delete Saved Queries

@Jay SenSharma When I tail the Ambari server log while attempting to delete, there is no new events written. Confirmed it works for other Ambari users, but no logs are written for successful saved query deletes either.

Highlighted

Re: Can't Delete Saved Queries

Super Mentor

@Daniel Thomas

You will need to enable the DEBUG log inside the view specific log4j properties like following to see the savedQuery deletion logging.

Example:
1. Edit the following file and change the following entry from INFO to DEBUG as following:

# grep DEBUG /var/lib/ambari-server/resources/views/work/HIVE\{2.0.0\}/view.log4j.properties
log4j.logger.org.apache.ambari.view.hive20=DEBUG,hive20


2. Restart ambari-server and the try deleting saved query.

# ambari-server restart
# curl -H "X-Requested-By: ambari" -u admin:admin -X DELETE http://localhost:8080/api/v1/views/HIVE/versions/2.0.0/instances/AUTO_HIVE20_INSTANCE/savedQueries/1


3. Now review the following log.

30 Oct 2017 19:17:54,800 DEBUG [ambari-client-thread-26] [HIVE 2.0.0 AUTO_HIVE20_INSTANCE] DataStoreStorage:123 - Deleting org.apache.ambari.view.hive20.resources.savedQueries.SavedQuery:1

.

Here in the above logging we see that the saved Query with ID =1 is deleted.

Highlighted

Re: Can't Delete Saved Queries

@Jay Kumar SenSharma There is definitely more logs coming in now, but no messages when trying to delete from the Ambari Views Hive 2.0 interface. Deleting using the curl commands via the RestAPI still works fine.

I've tested this with multiple Ambari users as well. Mixed results. When using a user with no imported queries (none created with the rest API) it seemed like I created a saved query from the web UI, couldn't delete. Deleted with RestAPI, then could create and delete from the GUI. However, the same approach didn't seem to work in an account that had imported queries.

Highlighted

Re: Can't Delete Saved Queries

@Jay SenSharma

It isn't a cache thing. Tried incognito, but still couldn't delete.

The curl commands did work, but I wouldn't expect end users to be able to do this. That said, it seems to only be affecting the admin user right now. I tried another account and it can create and delete queries fine.

I was using Ambari 2.5.1.0. I found the support page for Ambari View 2.5.2.0 for Hive 2 and it shows a little different. My views has "X"s next t othe items to delete, but the documentation shows gear icons to either delete or show the query history. I upgraded my version from 2.5.1.0->2.5.2.0, but my view looks the same (and still doesn't work).

Highlighted

Re: Can't Delete Saved Queries

Super Mentor

@Daniel Thomas

In that case can you please try the following:


Please remove the "*.gz" files (if present) from "/usr/lib/ambari-server/web/javascripts" directory on Ambari Server (Or take a backup and then remove)and make sure that this directory have only "vendor.js" and "app.js".


Then try again.

Highlighted

Re: Can't Delete Saved Queries

My installation doesn't have any extra .js files in this directory on the ambari server. Only these two. Mine are both dated Aug 30.

Don't have an account?
Coming from Hortonworks? Activate your account here