[SalesForce] Cannot save in DevConsole or Force IDE due to “unfinished save request” – How to resolve

Since the IDE and DevConsole was updated to use the Tooling API is sometimes run into situation where I cannot do a Save on a class change anymore. The Force.com IDE is giving no error at all and is hanging forever while the Dev Console tells me:

Unable to patch container member.: This container member belongs to a
container that currently has an unfinished save request with
deploymentId=1drd00000009nwy. You may not modify any members in this
container until it completes.: Metadata Container ID

I have no idea why that happens and how to resolve it. As a workaround I save my changes using the old-fashioned Web-UI.

Best Answer

Try to cancel the save, refresh the console, or both. To cancel the save, right click on the tab and click "Cancel Save". You can also click on the "Progress" tab on the bottom and click "Cancel All Deployments". The Progress tab gives you information on the status of the deploy, but if you are getting that error, it is probably because the save is never coming back.

Why might the save not come back?

The Tooling API save is asynchronous, and does not allow for 2 saves of the same entity to happen at the same time. When this happens, it means one of the following.

1) The server is under heavy load, and it is taking a while to pick up your save. Unfortunately, there isn't much that can be done about this one, except maybe canceling the request and trying again.

2) Something bad happened on the server and it is stuck in the save state. There are save guards to prevent this; the job should be switched to the FAILED state and the dev console should be notified. If it doesn't, it is a bug and you may never know an error happened without contacting Salesforce. The best thing to do is to just cancel the request if it takes too long and try again.

3) It finished but the dev console does not think it finished. The dev console gets notified by the Streaming API. There is a chance that the message didn't make it or never got sent, or the dev console session was refreshing when it came back. Another bug and more rare, but this one is a little easier to figure out by queuing for the status field of container deploy request in the dev console. Refreshing the console will fix this issue, or possibly canceling the save.

Similar to this question/solution: Failed to create deployment: This container has a save in progress with deploymentId=[YOUR-DEPLOYMENT-ID]

Related Topic