Skip to main content

Agentforce Builder fails right after naming the agent? Check your sandbox File Storage

 

The symptom

In a Developer sandbox, nobody could create a new agent in Agentforce Builder, admins included. You type the agent name, click next, and a red banner says the agent couldn't be created and to contact your Salesforce administrator. Nothing else: no error code, no detail.

We lost a few days to it, so here is what we found.

What we ruled out first

  • Permissions and licenses. It failed for every user, including System Administrators with the Agent Platform Builder permission set and license.
  • Org settings. Agent Platform and Einstein generative AI were both enabled.
  • Validation rules and triggers on User. None applied.
  • A CLI clue that pointed the wrong way. We reproduced the failure with sf agent publish authoring-bundle. The debug log showed a 404 from the agent authoring API, followed by a timeout on a sandbox fallback host. It matches an open CLI issue (forcedotcom/cli #3634), and we almost opened a support case over it. In our case it was not the cause.

The clue that mattered

Each failed attempt still created the agent's run-as user ("EinsteinServiceAgent User") and assigned its licenses and permission sets. Setup Audit Trail showed every step succeeding. So the failure happened later, when the agent itself was saved.

Then we checked the org limits:

 

 

sf limits api display -o <sandbox> | grep -i storage

File Storage: 248 MB used of 200 MB (124%).

One presentation file, a little over 240 MB, had been uploaded to the sandbox weeks earlier. Developer sandboxes allow only 200 MB of file storage. Once you're over the limit, the org refuses new files. We confirmed it by inserting a 1 KB ContentVersion, which failed with STORAGE_LIMIT_EXCEEDED. According to Salesforce Help, when data or file storage is over 100% in a sandbox, record creation can fail too, not just file uploads.

The timeline matched: the last successful agent save was before that upload, and every failure came after it.

The fix

  1. Find the largest files: 

     

     

SELECT Title, FileExtension, ContentSize, CreatedDate

FROM ContentVersion WHERE IsLatest = true

ORDER BY ContentSize DESC LIMIT 10

Download what you need to keep, then delete it from the org.

  1. Empty the Org Recycle Bin. Deleted files still count toward storage until the bin is emptied.
  2. Try again. With storage back under the limit, agent creation went through.

Clean up afterwards

Every failed attempt leaves an orphaned, active agent user, plus its permission set and license assignments. We had 12. Find them with:

 

 

SELECT Username, CreatedDate, CreatedBy.Name

FROM User

WHERE Profile.Name = 'Einstein Agent User'

ORDER BY CreatedDate DESC

Make sure no agent references them, then deactivate them.

Takeaways

  • In Agentforce Builder, a generic "couldn't create the agent" banner can hide a storage problem, not just permissions.
  • Developer sandboxes have small storage limits (200 MB data and 200 MB file storage). One large deck or recording is enough to hit the file limit.
  • Check sf limits api display early. It takes seconds and would have saved us days.

A note on certainty: we confirmed the root cause by removing it, since agent creation worked again right after the cleanup. We haven't seen it documented by Salesforce. If you've seen the same thing, please add it below.

 

 

 

#Agentforce  #Sandbox  #Salesforce CLI  #Storage Limit

0/9000