Support Questions

Find answers, ask questions, and share your expertise
Welcome to the upgraded Community! Read this blog to see What’s New!

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.


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.


@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.

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.

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\}/,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.


@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.

@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 I found the support page for Ambari View 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>, but my view looks the same (and still doesn't work).

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.


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.