# "OSError: \[Errno 28\] No space left on device" when uploading

**URL:** <https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370>\
**Category:** Command line tools\
**Created:** [September 19, 2021, 11:32am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370 "2021-09-19T11:32:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [September 19, 2021, 11:32am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/1 "2021-09-19T11:32:19Z")

</div>

mapillary\_tools 0.7.4.  
Uploading with ~300MB free on the root filesystem failed with the errors below.  
Upload happened from an external disk with hundreds of GB free.  
Could it be that the images are transferred to the system during upload?  
If so, could this be fixed so that only the source filesystem is filled up?

Uploading 992 images with valid mapillary tags (Skipping 7)  
Traceback (most recent call last):  
File “/usr/local/bin/mapillary\_tools”, line 11, in   
load\_entry\_point(‘mapillary-tools==0.7.4’, ‘console\_scripts’, ‘mapillary\_tools’)()  
File “/Library/Python/3.7/site-packages/mapillary\_tools/ **main**.py”, line 93, in main  
command.run(args)  
File “/Library/Python/3.7/site-packages/mapillary\_tools/commands/process\_and\_upload.py”, line 456, in run  
for k, v in vars\_args.items()  
File “/Library/Python/3.7/site-packages/mapillary\_tools/upload.py”, line 151, in upload  
dry\_run=dry\_run,  
File “/Library/Python/3.7/site-packages/mapillary\_tools/uploader.py”, line 248, in upload\_sequence\_v4  
ziph.write(fullpath, relpath)  
File “/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/zipfile.py”, line 1744, in write  
shutil.copyfileobj(src, dest, 1024\*8)  
File “/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/shutil.py”, line 82, in copyfileobj  
fdst.write(buf)  
File “/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/zipfile.py”, line 1098, in write  
self.\_fileobj.write(data)  
File “/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/tempfile.py”, line 481, in func\_wrapper  
return func(\*args, \*\*kwargs)

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [September 20, 2021, 4:57am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/2 "2021-09-20T04:57:31Z")

</div>

Free inodes? The logging process would use a lot, but the FS creation would have had to be pretty old… I had the problem when I was process and uploading from an older ext4(?) USB 500GB drive

df -i

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [September 20, 2021, 10:18am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/3 "2021-09-20T10:18:29Z")

</div>

Should be good, iused = 2638061, ifree = 4292329218.  
At the same time when mapillary\_tools failed, the OS also alerted about the root filesystem being full.

---

<div class="post-metadata">

**Author:** ![moenk](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/moenk/32/68240_2.png) [@moenk](https://forum.mapillary.com/u/moenk)\
**Post date:** [September 20, 2021, 10:34am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/4 "2021-09-20T10:34:02Z")

</div>

Maybe you try a loop to upload each directory seperate and delete the folder inside the script created?

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [September 20, 2021, 10:55am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/5 "2021-09-20T10:55:38Z")

</div>

Hmm, uploader.py has a compress step that references “tempfile” so I guess that could be using /tmp, Going out on a limb here the shell variable TMPDIR may be able to be assigned on a per process basis. eg before the mapillary tools command;

TMPDIR = /media/richlv/photdisk/tmp …

This is really a shot in the dark! Python itself has a module tempfile that I think does all this.

sorry not really helpful…

---

<div class="post-metadata">

**Author:** ![giocomai](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@giocomai](https://forum.mapillary.com/u/giocomai)\
**Post date:** [September 25, 2021, 7:17pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/6 "2021-09-25T19:17:41Z")

</div>

After some troubleshooting, I think I figured it out. On Linux (or at least, on Fedora, it may change by distribution), by default the temp folder is given half the space of RAM. So if you have e.g. 16gb ram, you’ll probably have 8gb for the temp folder. **This is not related to how much free space you have on your hard drive or on the external storage from where you’re doing the uploading.**

For whatever reason, before finalising a sequence Mapillary Uploader needs to move all of it in the temp folder. So just before you get this error you should see the RAM use increase, and the space in the /tmp/ folder decrease quickly. You can see this by checking the free space repeatedly from inside /tmp just before you get the error.

If the sequence you’re trying to upload is bigger than the current size given to /tmp, then you’ll get this error.

The easiest workaround is probably to simply temporarily give more space to /tmp, e.g.:

`mount -o remount,size=12G,noatime /tmp`

to give 12gb to /tmp.

This should be automatically reverted to default value after restart. For reference, [see e.g. this.](https://unix.stackexchange.com/questions/402637/tmp-directory-size-in-fedora)

---

<div class="post-metadata">

**Author:** ![bob3bob3](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/bob3bob3/32/68393_2.png) [@bob3bob3](https://forum.mapillary.com/u/bob3bob3)\
**Post date:** [September 25, 2021, 10:16pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/7 "2021-09-25T22:16:15Z")

</div>

Good find!

On Debian 10.x (at least) there is no separate /tmp mountpoint. It’s just a directory in the filesystem. There are however some “tmpfs” filesystems of limited size that may be involved.

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [September 27, 2021, 6:31am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/8 "2021-09-27T06:31:33Z")

</div>

Thanks, that confirms my suspicion.  
mapillary\_tools really, really should not be doing this. The filesystem where I’m uploading images should be the only one used during the process.

I’m wondering whether it’s the compressing step - which could then also explain the problem at [Page not found](http://mapillary.trydiscourse.com/t/mapillary-tools-does-repeated-compression/5196) .

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [October 1, 2021, 12:28pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/9 "2021-10-01T12:28:11Z")

</div>

Will solve in [Mapillary\_tools does repeated compression · Issue #437 · mapillary/mapillary\_tools · GitHub](https://github.com/mapillary/mapillary_tools/issues/437#issue-1013285041)

---

<div class="post-metadata">

**Author:** ![southglos](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@southglos](https://forum.mapillary.com/u/southglos)\
**Post date:** [October 4, 2021, 10:37pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/10 "2021-10-04T22:37:21Z")

</div>

I found similar when trying to use a Raspberry Pi to sit as a dedicated 24/7 Mapillary uploader (I take a lot of photos but have a slow upload link).

When the tools were updated and the compress-before-upload step added, I found things ground to a crawl for me. The photos are situated on a NAS (bit slow), and it was writing the temporary zip file to the local SD card (very slow). Fixed it by using an 8GB Pi and putting /tmp on tmpfs - each sequence is around 2-3GB, so it fits nicely in the default half-RAM limit.

I’d rather the compress stage were part of the prepare, rather than the upload step, but until that gets sorted I personally much prefer the temporary zip file being written to fast RAM-based /tmp, rather than going back and forth to the NAS it came from.

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [October 8, 2021, 7:39am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/11 "2021-10-08T07:39:15Z")

</div>

Interesting usecase - looks like a customisable temporary directory path would be highly desired.  
Perhaps worth adding that in the Github issue.

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [October 8, 2021, 4:37pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/12 "2021-10-08T16:37:37Z")

</div>

Hey @Richlv @southglos mapillary\_tools v0.8.0 is pre-released [Release v0.8.0 · mapillary/mapillary\_tools · GitHub](https://github.com/mapillary/mapillary_tools/releases/tag/v0.8.0)

It exposed the [zip command](https://github.com/mapillary/mapillary_tools#zip-images). Also it should be easier to integrate with your workflow. Let me know your feedback.

Have a great weekend!

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [December 11, 2021, 2:58pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/13 "2021-12-11T14:58:39Z")

</div>

Thanks you, will try this out 🙂  
What about the automatic process, are the archives preserved during runs (let’s say if an upload fails or is interrupted)?

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [September 19, 2022, 1:11pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/14 "2022-09-19T13:11:35Z")

</div>

Hi @tao, trying mapillary\_tools 0.9.0 - TMPDIR is set to an external disk, but during the “Uploading import path” phase, root directory ends up seeing major usage increase.  
Before I look into this further - is TMPDIR supposed to work properly in 0.9.0?

---

<div class="post-metadata">

**Author:** ![boris](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/boris/32/71767_2.png) [@boris](https://forum.mapillary.com/u/boris)\
**Post date:** [February 27, 2025, 11:40am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/18 "2025-02-27T11:40:24Z")

</div>

@GITNE - we’re actually working on a project now that will eliminate the need to create these intermediary .zip files to speed up the upload process and remove some of the friction here. We hope to have it out this half. cc: @Yaro and @tao

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [March 7, 2025, 6:17pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/20 "2025-03-07T18:17:09Z")

</div>

I vaguely recall that these zips were introduced when Mapillary was absorbed by FB, because they had to move to a standard approach in the FB infrastructure. It made uploading a notably worse experience both in the mobile app (where sequences became “locked”) and in the CLI tools (where the problems with these temporary archives appeared).

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eric\_S](https://forum.mapillary.com/u/Eric_S)\
**Post date:** [June 14, 2025, 7:12pm UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/21 "2025-06-14T19:12:46Z")

</div>

I’m also facing the issue with no space left on device (Desktop uploader on windows). The sequence to upload (7 GB) is on a disk with plenty of free space (80 GB). I imagine that the device with no space left is where is “C:\Users\xxx\AppData\Roaming\Mapillary Uploader” i.e. C drive (1.8 GB left).

 ![image](https://us1.discourse-cdn.com/flex015/uploads/mapillary/original/3X/5/2/52fa3aee7ff6886a9673ce71b87f68222095fc91.png)

```auto
[2025-06-14 20:51:39.880] [debug] [mapillary:tools] 2025-06-14 20:51:39,878 - DEBUG - HTTP GET https://graph.mapillary.com//954303792879264 HEADERS={'Authorization': '[REDACTED]'} TIMEOUT=60

[2025-06-14 20:51:40.126] [debug] [mapillary:tools] 2025-06-14 20:51:40,125 - DEBUG - HTTP 200 (OK): {"slug": "eucameragrant9", "name": "EU Camera Grant 9", "id": "954303792879264"}

[2025-06-14 20:51:40.127] [debug] [mapillary:tools] 2025-06-14 20:51:40,125 - INFO - Uploading to organization: {"slug": "eucameragrant9", "name": "EU Camera Grant 9", "id": "954303792879264"}

[2025-06-14 20:52:11.886] [debug] [mapillary:tools] Traceback (most recent call last):
  File "mapillary_tools\upload.py", line 568, in upload

[2025-06-14 20:52:11.888] [debug] [mapillary:tools] mapillary_tools.upload.UploadError: [Errno 28] No space left on device

[2025-06-14 20:52:11.888] [debug] [mapillary:tools] During handling of the above exception, another exception occurred:

```

---

<div class="post-metadata">

**Author:** ![nikola](https://avatars.discourse-cdn.com/v4/letter/n/a88e57/32.png) [@nikola](https://forum.mapillary.com/u/nikola)\
**Post date:** [June 16, 2025, 8:58am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/22 "2025-06-16T08:58:46Z")

</div>

Yes, the free space on the disk where the temporary files are stored will be the limiting factor when uploading images. For a successful upload, it needs an amount of free space that matches the size of the current upload. We’ll be updating our upload process in the next release to remove this hurdle.

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eric\_S](https://forum.mapillary.com/u/Eric_S)\
**Post date:** [June 16, 2025, 9:08am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/23 "2025-06-16T09:08:47Z")

</div>

In the mean time, I made some cleaning on the correspond disk and was able to upload.

---

<div class="post-metadata">

**Author:** ![Richlv](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.mapillary.com/richlv/32/68232_2.png) [@Richlv](https://forum.mapillary.com/u/Richlv)\
**Post date:** [June 16, 2025, 10:38am UTC](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370/24 "2025-06-16T10:38:21Z")

</div>

Thanks, is that similar to the recent improvement in the iOS app (reverting back from the Facebook mandated upload approach), where it stops zipping it all up?

When could that be expected in `mapillary_tools`?

[Next page](https://forum.mapillary.com/t/oserror-errno-28-no-space-left-on-device-when-uploading/5370.md?page=2)
