<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Permission denied during write in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107288#M9662</link>
    <description>&lt;P&gt;This is the error message I get:&amp;nbsp;&lt;SPAN&gt;[Errno 13] Permission denied: '.tmp/MeterReadContinuous-d7cc2215-5b75-419c-a843-06e712a94ac8'&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2025 19:50:55 GMT</pubDate>
    <dc:creator>Daan</dc:creator>
    <dc:date>2025-01-27T19:50:55Z</dc:date>
    <item>
      <title>Permission denied during write</title>
      <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107123#M9660</link>
      <description>&lt;P&gt;Hey everyone,&lt;BR /&gt;&lt;BR /&gt;I have a pipeline that fetches data from s3 and stores them under the Databricks .tmp/ folder.&lt;BR /&gt;The pipeline is always able to write around 200 000 files before I get a Permission Denied error. This happens in the following code block:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;os.&lt;/SPAN&gt;&lt;SPAN&gt;makedirs&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;".tmp/&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;filename_base[:&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;exist_ok&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;True&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;There are no duplicates in filename_base[:-4].&lt;BR /&gt;&lt;BR /&gt;Any idea why that is the case?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Jan 2025 08:13:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107123#M9660</guid>
      <dc:creator>Daan</dc:creator>
      <dc:date>2025-01-27T08:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied during write</title>
      <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107253#M9661</link>
      <description>&lt;P&gt;Can you share the specific error message you are receiving?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 14:26:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107253#M9661</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2025-01-27T14:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied during write</title>
      <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107288#M9662</link>
      <description>&lt;P&gt;This is the error message I get:&amp;nbsp;&lt;SPAN&gt;[Errno 13] Permission denied: '.tmp/MeterReadContinuous-d7cc2215-5b75-419c-a843-06e712a94ac8'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 19:50:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107288#M9662</guid>
      <dc:creator>Daan</dc:creator>
      <dc:date>2025-01-27T19:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied during write</title>
      <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107398#M9663</link>
      <description>&lt;P class="_1t7bu9h1 paragraph"&gt;The "Permission Denied" error you are encountering when using &lt;CODE&gt;os.makedirs&lt;/CODE&gt; to create directories under the Databricks &lt;CODE&gt;.tmp/&lt;/CODE&gt; folder is likely due to concurrency issues or permission restrictions on the &lt;CODE&gt;.tmp/&lt;/CODE&gt; directory.&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;Here are a few potential reasons and solutions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Concurrency Issues&lt;/STRONG&gt;: If multiple tasks are trying to create directories at the same time, it can lead to race conditions. This is supported by the context from the Databricks Community and Slack discussions, where similar issues were observed when there was high parallelism or multiple tasks running concurrently. Adding some randomness to the directory names or implementing a retry mechanism can help mitigate this issue.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;STRONG&gt;Permission Restrictions&lt;/STRONG&gt;: The &lt;CODE&gt;.tmp/&lt;/CODE&gt; directory might have specific permission settings that prevent the creation of a large number of files or directories. This is suggested by the context from the Databricks Community, where permission errors were encountered when trying to create directories on certain volumes or paths.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&lt;STRONG&gt;Volume-Specific Issues&lt;/STRONG&gt;: If you are using a specific S3 bucket or volume, there might be permission issues related to that storage. As seen in the Slack discussion, switching to a different bucket resolved the issue for another user.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;To address the issue, you can try the following steps:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Add Randomness&lt;/STRONG&gt;: Modify your directory creation logic to include some randomness in the directory names to reduce the likelihood of collisions.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Implement Retries&lt;/STRONG&gt;: Add a retry mechanism to handle transient permission errors.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Check Permissions&lt;/STRONG&gt;: Ensure that the &lt;CODE&gt;.tmp/&lt;/CODE&gt; directory and the underlying storage have the necessary permissions for creating directories.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Use Databricks Utilities&lt;/STRONG&gt;: Instead of using &lt;CODE&gt;os.makedirs&lt;/CODE&gt;, you can use &lt;CODE&gt;dbutils.fs.mkdirs&lt;/CODE&gt; which is designed to work with Databricks file systems and might handle permissions more gracefully.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 28 Jan 2025 13:27:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107398#M9663</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2025-01-28T13:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Permission denied during write</title>
      <link>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107409#M9664</link>
      <description>&lt;P&gt;Thanks for your reply Walter! The filenames are already unique, retries produce the same result and I have the necessary permission as I was able to write the other 200 000 files (with the same program that is running continuous).&amp;nbsp;&lt;BR /&gt;It does makes sense to use Databricks Utilities however. Will try it out and let you know.&amp;nbsp;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 13:49:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/permission-denied-during-write/m-p/107409#M9664</guid>
      <dc:creator>Daan</dc:creator>
      <dc:date>2025-01-28T13:49:14Z</dc:date>
    </item>
  </channel>
</rss>

