Resolving "could not query for stack: denied" error

Last updated: March 11, 2026

If you encounter a "could not query for stack: denied" error, this is typically related to space permissions and hierarchy.

Understanding the Error

This error occurs when your administrative stack doesn't have the proper permissions to access the target stack. The issue is often related to the spaces where the stacks are located.

Solution

To resolve this issue, you need to ensure that the target stack is in a space that your administrative stack can access. Here are the steps:

  1. Check the space hierarchy: Verify that the target stack's space is a child of your administrative stack's space, or that your administrative stack has the necessary permissions to access it.

  2. Move the stack to the correct space: If the target stack is in an inaccessible space, move it to a space where your administrative stack has permissions.

  3. Retry the run/command: Once the stack is in the correct space, retry your run/command.

Example Scenario

If your administrative stack is in space cloud-projects-dev and you're trying to import a stack that's in a child space demo-project-dev, this will fail if these spaces don't have the proper parent-child relationship or stack role permissions.

Moving the target stack to a space your stack has access to or giving your stack the appropriate permissions through stack roles the should resolve the issue.

Note: This solution applies whether you're using RBAC or the deprecated administrative feature.