Troubleshooting
Guide to solving common problems with Polycrate: Docker, workspace, blocks, actions, workflows, SSH and performance, with problem descriptions and solution steps.
Troubleshooting
This guide helps you solve common problems with Polycrate.
Docker problems
"Cannot connect to Docker daemon"
Problem: Polycrate cannot connect to the Docker daemon.
Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock
Solutions:
-
Check whether Docker is running:
docker ps -
Start Docker:
# Linux (systemd) sudo systemctl start docker # macOS/Windows # Start Docker Desktop -
Check permissions:
# Linux - add the user to the docker group sudo usermod -aG docker $USER newgrp docker -
Check the socket path:
ls -la /var/run/docker.sock
"Image not found" or pull errors
Problem: Polycrate cannot find or download the workspace image.
Error: Error response from daemon: pull access denied for cargo.ayedo.cloud/library/polycrate
Solutions:
-
Check your internet connection
-
Authenticate with the registry:
docker login cargo.ayedo.cloud -
Use a different image:
polycrate run my-block install --image-ref <alternative-image> -
Skip the pull (if the image is already local):
polycrate run my-block install --pull false
Container does not start
Problem: The Polycrate container does not start or crashes immediately.
Solutions:
-
Check the container logs:
docker logs <container-id> -
Check the Polycrate logs:
ls -la .logs/ cat .logs/<latest-log-file> -
Increase the log level:
polycrate run my-block install --loglevel 2 -
Test the container manually:
docker run -it --rm cargo.ayedo.cloud/library/polycrate:latest /bin/sh
Bind mount error on macOS with OrbStack (0.36.0)
Problem: On macOS with OrbStack (or other alternative Docker runtimes) the action execution fails with a bind mount error. The error message typically contains the path /var/run/com.apple.launchd.*/Listeners.
Error: failed to create container: ... bind mount source path does not exist:
/var/run/com.apple.launchd.XXXXX/Listeners
Cause: The SSH agent socket (SSH_AUTH_SOCK) is mounted into the container. On macOS SSH_AUTH_SOCK points to a launchd socket that OrbStack cannot pass through into the Docker VM.
Solution (since 0.37.0): The SSH agent mount is disabled by default. If you enabled the mount explicitly and this problem occurs, remove the activation:
- Remove
--ssh-agent-mountfrom the CLI call - Remove
sshagentmount: truefromworkspace.poly
Solution (0.36.x): Disable the SSH agent mount with --no-ssh-agent-mount or config.sshagentmount: false.
Action run submission fails: exit code -1 (before 0.36.0)
Problem: An action run is submitted to the Polycrate API, but the API rejects it because the exit code is -1. The API expects exit codes >= 0.
Error: exit_code: Ensure this value is greater than or equal to 0
Cause: Before version 0.36.0, Docker infrastructure errors (container create, attach, start) returned exit code -1, which was an internal sentinel value. The API only accepts POSIX-compliant exit codes (0–255).
Solution: Update to Polycrate CLI >= 0.36.0. All infrastructure errors now return exit code 1:
polycrate update 0.51.3
Workspace problems
"Not a valid workspace"
Problem: Polycrate does not recognize the directory as a workspace.
Error: Not a valid workspace: workspace.poly not found
Solutions:
-
Check whether
workspace.polyexists:ls -la workspace.poly -
Initialize a new workspace (in the target directory):
mkdir -p ~/polycrate-workspaces/my-workspace cd ~/polycrate-workspaces/my-workspace polycrate workspace init --with-name my-workspace -
Specify the workspace path explicitly:
polycrate run my-block install --workspace /path/to/workspace
Workspace encryption fails
Problem: Encrypting or decrypting the workspace fails.
Solutions:
-
Check the encryption status:
polycrate workspace status -
Make sure you are using the correct passphrase
-
Check whether encrypted files exist:
ls -la *.enc -
Create a backup before encrypting:
cp workspace.poly workspace.poly.backup polycrate workspace encrypt
Snapshot errors
Problem: The snapshot cannot be generated.
Solutions:
-
Validate your workspace configuration:
polycrate workspace inspect -
Check for syntax errors in
workspace.poly:# Use a YAML validator yamllint workspace.poly -
Test the snapshot in isolation:
polycrate workspace snapshot
Block problems
"Block not found"
Problem: Polycrate cannot find a block.
Error: Block 'my-block' not found in workspace
Solutions:
-
List all available blocks:
polycrate block list -
Check the block directory:
ls -la blocks/ -
Pull the block from the registry (full path!):
polycrate blocks pull registry.my-org.com/infra/my-block:1.0.0 -
Check the block configuration:
cat blocks/my-block/block.poly
Block validation fails
Problem: Block validation fails.
Error: Block configuration validation failed
Solutions:
-
Validate the block:
polycrate block validate my-block -
Check
block.polyfor syntax errors:yamllint blocks/my-block/block.poly -
Inspect the block configuration:
polycrate block inspect my-block
Block push/pull fails
Problem: The block cannot be pushed to or pulled from the registry.
Solutions:
-
Authenticate with the registry:
docker login cargo.ayedo.cloud # or for a custom registry: docker login my.registry.com -
Check the registry URL (full path with version!):
# Full registry path required polycrate blocks pull my.registry.com/my-org/my-block:1.0.0 -
Check the block version:
# In block.poly cat blocks/my-block/block.poly | grep version -
Check the network connection to the registry:
curl -I https://cargo.ayedo.cloud
Action problems
"Action not found"
Problem: The action does not exist or cannot be found.
Error: Action 'install' not found in block 'my-block'
Solutions:
-
List all available actions:
polycrate action list -
Inspect the block:
polycrate block inspect my-block -
Check the block configuration:
cat blocks/my-block/block.poly
Action fails
Problem: The action execution fails with an error.
Solutions:
-
Increase the log level:
polycrate run my-block install --loglevel 2 -
Check the logs:
cat .logs/<latest-log-file> -
Run the action locally (for debugging):
polycrate run my-block install --local -
Inspect the action:
polycrate action inspect my-block install -
Test with a snapshot (without execution):
polycrate run my-block install --snapshot
Ansible errors
Problem: The Ansible playbook fails.
Solutions:
-
Check the Ansible syntax:
# In the block directory ansible-playbook --syntax-check install.yml -
Increase Ansible verbosity:
polycrate run my-block install --loglevel 2 -
Check the inventory:
cat inventory.yml ansible-inventory -i inventory.yml --list -
Test the Ansible connection:
ansible all -i inventory.yml -m ping
Workflow problems
Workflow fails
Problem: The workflow execution fails.
Solutions:
-
List all workflows:
polycrate workflow list -
Inspect the workflow:
polycrate workflow inspect my-workflow -
Run the steps individually:
# Run each step individually to find the failing step polycrate run step-1-block step-1-action -
Use
allow_failurefor optional steps:workflows: - name: my-workflow steps: - name: optional-step block: my-block action: optional-action allow_failure: true
SSH problems
SSH connection fails
Problem: The SSH connection to the remote host fails.
Error: SSH connection failed
Solutions:
-
Check the SSH keys:
ls -la id_rsa id_rsa.pub chmod 600 id_rsa chmod 644 id_rsa.pub -
Test the SSH connection manually:
ssh -i id_rsa user@host -
Check the inventory:
cat inventory.yml -
Use an SSH passphrase ⚠️ Experimental:
echo "my-passphrase" > ssh-passphrase.poly polycrate workspace encrypt polycrate run my-block install --ssh-use-passphrase -
Check authorized_keys on the remote host:
cat ~/.ssh/authorized_keys
Performance problems
Polycrate is slow
Problem: Polycrate execution takes very long.
Solutions:
-
Skip the image pull (if already present):
polycrate run my-block install --pull false -
Skip the image build (if there is no custom Dockerfile.poly):
polycrate run my-block install --build false -
Run locally (if possible):
polycrate run my-block install --local -
Check Docker performance:
docker stats -
Increase Docker resources (Docker Desktop): - Settings → Resources → Increase CPU/Memory
Container takes long to build
Problem: The custom container image takes a long time to build.
Solutions:
-
Optimize your Dockerfile.poly:
# Dockerfile.poly FROM cargo.ayedo.cloud/library/polycrate:latest # Cache-friendly layer order (Ubuntu-based!) RUN apt-get update && apt-get install -y --no-install-recommends \ tool1 tool2 \ && rm -rf /var/lib/apt/lists/* -
Use the Docker build cache:
# Enable the Docker Desktop build cache -
Skip the build if possible:
polycrate run my-block install --build false
Configuration problems
Environment variables in YAML do not work
Problem: The ${VAR} syntax in workspace.poly or block.poly is not resolved.
# ❌ Does NOT work - YAML does not support env var substitution
config:
api_key: ${API_KEY} # stays literally "${API_KEY}"
Solution: Use secrets.poly for sensitive configuration:
# workspace.poly - public configuration
name: my-workspace
blocks:
- name: my-app
from: registry.my-org.com/infra/app:1.0.0
config:
namespace: production
# secrets.poly - sensitive configuration (store encrypted!)
blocks:
- name: my-app
config:
api_key: my-secret-api-key
database_password: db-password
# Encrypt the workspace before git push
polycrate workspace encrypt
Merge conflicts in configuration
Problem: Configurations are not merged correctly.
Solutions:
-
Enable merge debugging:
polycrate run my-block install --merge-debug -
Use merge v2:
polycrate run my-block install --merge-v2 -
Inspect the final snapshot:
polycrate run my-block install --snapshot > snapshot.yml cat snapshot.yml
Registry problems
"Registry authentication failed"
Problem: Authentication with the registry fails.
Solutions:
-
Login via Docker:
docker login cargo.ayedo.cloud Username: your-username Password: your-password -
Check the Docker config:
cat ~/.docker/config.json -
Use an API key instead of a password:
docker login cargo.ayedo.cloud -u your-username -p your-api-key
"Rate limit exceeded"
Problem: Too many requests to the registry.
Solutions:
-
Authenticate (higher limits for authenticated users):
docker login cargo.ayedo.cloud -
Wait and try again later
-
Use a mirror/cache
Common error messages
"permission denied"
- Check file permissions:
chmod 755 file - Check Docker permissions:
sudo usermod -aG docker $USER - Check SSH key permissions:
chmod 600 id_rsa
"no space left on device"
- Check disk space:
df -h - Clean up Docker:
docker system prune -a - Clean up Polycrate logs:
rm -rf .logs/* - Clean up artifacts:
polycrate run my-block prune(if the block has apruneaction)
"port already in use"
- Check used ports:
netstat -tuln | grep <port> - Stop conflicting containers:
docker psanddocker stop <container> - Use a different port in the configuration
"connection timeout"
- Check the network connection
- Check firewall rules
- Increase timeout values
- Check DNS resolution:
nslookup host
Debugging tips
Extended logs
# Maximum log level
polycrate run my-block install --loglevel 2
# JSON format for machine processing
polycrate run my-block install --logformat json
# YAML format
polycrate run my-block install --logformat yaml
Interactive mode
# The container stays open for interactive commands
polycrate run my-block install --interactive
Analyzing the snapshot
# Generate and analyze the snapshot
polycrate run my-block install --snapshot > snapshot.yml
# Check for specific values
cat snapshot.yml | grep "key_name"
# Filter with yq
yq eval '.blocks[].config' snapshot.yml
Debugging the container
# Open a shell in the container
docker run -it --rm \
-v $(pwd):/workspace \
cargo.ayedo.cloud/library/polycrate:latest \
/bin/sh
# Inside the container
cd /workspace
ls -la
Support
If you cannot solve the problem:
-
Check the documentation: - CLI reference - Best practices
-
Ask the community: - Discord server - GitHub Discussions
-
Create an issue: - GitHub Issues - Include logs, configuration and reproduction steps