sap-repair-joule-access
Skill9 starsChanged 24 days agoApache-2.0View on GitHub
Diagnose and resolve SAP Joule CLI login, HTTP 401/403, and missing capability deployment access in this Cookbook. Use when `joule list`, `joule compile`, or `joule deploy` fails because the session is logged out or stale, the IAS trust origin is wrong, or the user lacks the Terraform-managed Joule Developer assignment containing `end_user`, `extensibility_developer`, and `capability_admin`.
In this repository8 other files it gives its agents.
- sap-ai-coreSkill
- sap-hana-data-prepSkill
- sap-hana-tripleSkill
- sap-hana-vectorSkill
- sap-joule-capabilitySkill
- sap-kyma-cliSkill
- sap-setup-btp-agentSkill
- sap-sovereign-regionsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Never drive an interactive Joule or BTP SSO/passcode flow for the user.
- Distinctive: line 14
Never log the user out or retry login in a loop.
- Distinctive: line 15
Never print, persist, or request client secrets or binding JSON.
- Distinctive: line 16
Use read-only checks first.
- Distinctive: line 19
Stop if a plan contains unrelated changes, replacements, deletions, or paid service changes.
- Very specific: line 24
Run the failing Joule command once and retain its exact output.
- Very specific: line 37
Use ./scripts/joule-login.sh --create-binding only when the binding is absent and the user has authorized creating it.
- Distinctive: line 57
Verify all of the following:
- Very specific: line 65
If all three are correct, do not change Terraform.
- Distinctive: line 70
Add the affected IAS user to the managed capability-deployer variable in the existing environment tfvars file:
- Distinctive: line 90
Create a saved plan with the same variable files used by the target account, then run the policy check.
- Very specific: line 107
After a successful apply, hand off ./scripts/joule-login.sh once so the user receives a fresh token.
- Distinctive: line 113
Stop and explain the remaining administrative boundary when:
- Distinctive: line 120
Do not claim that Terraform can complete an IAS activation or tenant-specific App2App administration step that the SAP provider does not …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Resolve Joule access
Diagnose the failure before proposing a change. Treat login, authorization, and IAS App2App setup as separate problems.
Guardrails
- Never drive an interactive Joule or BTP SSO/passcode flow for the user.
- Never log the user out or retry login in a loop.
- Never print, persist, or request client secrets or binding JSON.
- Use read-only checks first. Do not mutate roles directly with the BTP CLI.
- Repair managed access through Terraform. Show the plan and obtain approval before applying it to a live subaccount.
- Stop if a plan contains unrelated changes, replacements, deletions, or paid service changes.
Diagnose once
Run the failing Joule command once and retain its exact output. Use
joule -w status only to identify the current login and user.
Classify the result:
Logged out,
AUTH_LOAD_FAILED, or no current user: hand off this command and stop so the user can complete the passcode flow in their own terminal:cd infra/btp ./scripts/joule-login.shUse
./scripts/joule-login.sh --create-bindingonly when the binding is absent and the user has authorized creating it.- HTTP 401/403 after a previously valid login: inspect the role collection and assignment below. A token issued before a role change can remain stale.
- Any other error: report it as a non-authorization failure and do not change roles.
Inspect authorization
Confirm the Terraform target before inspecting BTP:
subaccount_id="$(terraform -chdir=infra/btp output -raw subaccount_id)"
btp --format json get security/role-collection "Joule Developer" \
--subaccount "$subaccount_id"
btp --format json get security/role-collection "Joule Developer" \
--subaccount "$subaccount_id" --show-user-assignments trueVerify all of the following:
Joule Developercontainsend_user,extensibility_developer, andcapability_adminfromdas-application.- The affected user is assigned to
Joule Developer. - The assignment origin matches the IAS trust used for login, normally
sap.customin this Cookbook.
If all three are correct, do not change Terraform. Explain that the cached
Joule token is stale, hand off ./scripts/joule-login.sh once, and stop.
Repair a missing assignment
Add the affected IAS user to the managed capability-deployer variable in the existing environment tfvars file:
joule_capability_deployer_users = [
"user@example.com",
]For the split infra/btp/stacks/joule deployment, use the equivalent variable:
capability_deployer_users = [
"user@example.com",
]Preserve existing users. Do not add unrelated Process Automation roles just to make Joule capability deployment work.
Create a saved plan with the same variable files used by the target account, then run the policy check. For the live Cookbook stack this is typically:
terraform -chdir=infra/btp plan \
-var-file=live-test.tfvars \
-var-file=live-joule.tfvars \
-out=/tmp/joule-access.tfplan
infra/btp/scripts/check-plan.sh --chdir infra/btp /tmp/joule-access.tfplanRequire approval before applying the saved plan:
terraform -chdir=infra/btp apply /tmp/joule-access.tfplanAfter a successful apply, hand off ./scripts/joule-login.sh once so the user
receives a fresh token. Then verify joule -w list and retry the original
compile or deploy command.
Stop conditions
Stop and explain the remaining administrative boundary when:
- the BTP session is expired; ask the user to run
btp login --sso; - the required
das-applicationrole templates are unavailable; - the IAS trust origin or Joule Studio App2App flow is not configured; or
- the safe Terraform plan cannot isolate the intended role assignment.
Do not claim that Terraform can complete an IAS activation or tenant-specific App2App administration step that the SAP provider does not expose.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

