Permission Denied
Fix permission denied errors in Moltbot.
Permission Denied
Getting "permission denied" or "access denied" errors? Here's how to fix them.
Symptoms
Error: EACCES: permission denied, open '/app/data/config.json'or
PermissionError: [Errno 13] Permission deniedLikely Causes
- Docker volume permissions - mounted volumes have wrong ownership
- File system permissions - files not readable/writable
- API permissions - bot lacks required permissions
- Skill permissions - skill trying to access unauthorized resources
Fix Steps
Docker Volume Permissions
Option 1: Match container user
# Find the container's user ID
docker exec moltbot id
# Usually uid=1000 or uid=node
# Set ownership on host
sudo chown -R 1000:1000 ./dataOption 2: Use Docker's user flag
# docker-compose.yml
services:
moltbot:
user: "${UID}:${GID}"
volumes:
- ./data:/app/dataOption 3: More permissive (dev only)
chmod -R 777 ./data # NOT for production!File System Permissions
# Check current permissions
ls -la /path/to/file
# Fix ownership
sudo chown $USER:$USER /path/to/file
# Fix permissions (read/write for owner)
chmod 644 /path/to/file
# For directories
chmod 755 /path/to/directoryAPI Permissions (Telegram)
Ensure your bot has the right permissions:
- Go to @BotFather
- Send
/mybots - Select your bot
- Check "Bot Settings" → "Group Privacy"
For group messages, you may need to:
- Disable privacy mode
- Make bot an admin
API Permissions (Discord)
- Go to Discord Developer Portal
- Select your application
- Go to OAuth2 → URL Generator
- Ensure required permissions are selected
- Re-invite bot with new permissions
Skill Permissions
If a skill is denied access:
# Check skill configuration
cat .env | grep SKILL_
# Enable specific skill permissions
SKILL_FILE_ACCESS=true
SKILL_FILE_PATHS=/home/user/allowed-dirVerify
After fixing:
# Test file access
docker exec moltbot ls -la /app/data
# Test write access
docker exec moltbot touch /app/data/test && echo "Write OK"Prevent
- Plan volume permissions before deployment
- Use named Docker volumes for automatic management
- Document required bot permissions
- Use least privilege principle