Claude Code deployment

Permission Denied When Writing Files

Application attempts to write files (logs, uploads, caches) but fails with permission denied errors. The user running the application doesn't have write permissions to the target directory. Works in development where user has full permissions but fails in production.

This commonly occurs with log files, uploaded files, or temporary cache directories.

Error Messages You Might See

java.io.IOException: Permission denied Cannot write to file: access denied Failed to create log file: permission denied
java.io.IOException: Permission deniedCannot write to file: access deniedFailed to create log file: permission denied

Common Causes

  1. Target directory owned by different user, application user lacks write permission
  2. Directory permissions too restrictive (755 prevents write by non-owner)
  3. Parent directory doesn't have execute bit, preventing access to subdirectories
  4. SELinux or AppArmor policies blocking file access
  5. Disk full, preventing new writes despite having permissions

How to Fix It

Check permissions: ls -la /path/to/dir. Change if needed: chmod 755 or chown to correct user. Ensure application user is owner or in group: chown app:app /logs. Create directories with correct permissions at startup. Use world-writable temp directories (/tmp) if needed. Run with sudo or correct user: sudo -u app java -jar app.jar

Real developers can help you.

Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. BurnHavoc BurnHavoc Been around fixing other peoples code for 20 years. Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/ prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Alvin Voo Alvin Voo I’ve watched the tech landscape evolve over the last decade—from the structured days of Java Server Pages to the current "wild west" of Agentic-driven development. While AI can "vibe" a frontend into existence, I specialize in the architecture that keeps it from collapsing. My expertise lies in the critical backend infrastructure: the parts that must be fast, secure, and scalable. I thrive on high-pressure environments, such as when I had only three weeks to architect and launch an Ethereum redemption system with minimal prior crypto knowledge, turning it into a major revenue stream. What I bring to your project: Forensic Debugging: I don't just "patch" bugs; I use tools like Datadog and Explain Analyzers to map out bottlenecks and resolve root causes—like significantly reducing memory usage by optimizing complex DB joins. Full-Stack Context: Deep experience in Node.js and React, ensuring backends play perfectly with mobile and web teams. Sanity in the Age of AI: I bridge the gap between "best practices" and modern speed, ensuring your project isn't just built fast, but built to last.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How to check file permissions?

ls -l shows permissions: rwx for owner, group, others. First digit (1-9) is: d (dir), r (read), w (write), x (execute).

How to fix permission denied?

Change ownership: sudo chown app:app /path. Change permissions: chmod 755 /path. Format: chmod u+rw,g+r,o+r /path

What user should own application directories?

Create dedicated user (app). Change directory ownership: chown -R app:app /app. Run with that user: sudo -u app

Related Claude Code Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help