<p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>...</li>
<li>...</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 0.165.0<br>
<strong>System</strong>: linux 3.17.0-031700-generic<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: EACCES, open '/home/joao/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At fs.js:75

Error: EACCES, open '/home/joao/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'
  at Error (native)
"><pre class="notranslate"><code class="notranslate">At fs.js:75

Error: EACCES, open '/home/joao/.atom/compile-cache/cson/5af7724b023a6274b520f79f04fb798a67319ca7.json'
  at Error (native)

</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<h3 dir="auto">Config</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;core&quot;: {
    &quot;disabledPackages&quot;: [
      &quot;metrics&quot;
    ]
  }
}"><pre class="notranslate"><code class="notranslate">{
  "core": {
    "disabledPackages": [
      "metrics"
    ]
  }
}
</code></pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
No installed packages

# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
<span class="pl-en">No</span> <span class="pl-en">installed</span> packages

<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div>
<p dir="auto">Just a moment ago I stumbled upon a similar issue to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="38535094" data-permission-text="Title is private" data-url="https://github.com/atom/atom/issues/3056" data-hovercard-type="issue" data-hovercard-url="/atom/atom/issues/3056/hovercard" href="https://github.com/atom/atom/issues/3056">#3056</a>. As a background: I do like atom so much, that I started it to use it as a drop-in replacement for gedit. Even to edit system configuration files. In this scenario it's quite common to invoke editors via sudo.</p>
<p dir="auto">Atom will start in a broken state if you it was previously launched i.e with something like <code class="notranslate">sudo atom /etc/hosts</code>,  because in this case <code class="notranslate">$HOME</code> still points the original user directory, though the process is started under root privileges. This seems to be <a href="https://security.stackexchange.com/a/18399" rel="nofollow">a distribution specific default behavior of sudo</a>.</p>
<p dir="auto">As result <strong>any file created</strong> in this Atom session will become unwriteable for the original user and will lead to application errors inside Atom:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[30615:0724/202223:INFO:CONSOLE(29)] &quot;Error: EACCES, permission denied '/home/ben/.atom/compile-cache/less/62b7a669af25a948e0632eac5cb2bf860f9c0e6e/imports.json'"><pre class="notranslate"><code class="notranslate">[30615:0724/202223:INFO:CONSOLE(29)] "Error: EACCES, permission denied '/home/ben/.atom/compile-cache/less/62b7a669af25a948e0632eac5cb2bf860f9c0e6e/imports.json'
</code></pre></div>
<p dir="auto">To be honest: You are able run into similar issues on other programs too, but most of them tend not to create new files unless triggered. I'm not aware which actions trigger Atom to create new files under <code class="notranslate">$HOME</code> <em>after the initial first launch</em> for a user.</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>Start <code class="notranslate">atom</code> and exit</li>
<li><code class="notranslate">rm -r ~/.atom/compile-cache/less</code> to provoke Atom creating new files</li>
<li><code class="notranslate">sudo atom</code> and exit</li>
<li><code class="notranslate">atom</code></li>
</ol>
<p dir="auto">This will be the case on all plattforms, where sudo keeps the original $HOME setting which can be tested i.e. by calling <code class="notranslate">sudo sh -c 'echo $HOME'</code></p>