Cloudinary CLI fails to sync files with certain names (double extension)
I'm having an issue with syncing cloudinary directory which contains images that are named in certain way. For example image_one.jpg.png image_two.png.png etc. Those files are downloaded over and over but they are all corrupted and 0 byte files.
Any way on how to go around this?
-
Hi,
Unfortunately, I'm unable to reproduce the scenario you described.
Can you please share the command you pass to sync? If you can also share your cloud name, we can also try to take a look what happened.
Regards,
Erwin Lukas0 -
Cloud name is: focloud
Command I run is (tried with -F flag too):
```
$ cld sync --pull MaennerOutfits.ch MaennerOutfits.ch
Found 0 items in local folder 'MaennerOutfits.ch'Downloaded '1529490197_7.jpg' to '/data/backup/MaennerOutfits.ch/1529490197_7.jpg.jpg'
Downloaded '10011902_1547127322test.png' to '/data/backup/MaennerOutfits.ch/10011902_1547127322test.png.jpg'
Downloaded '23062009_1592895816AlltagsOutfit.png' to '/data/backup/MaennerOutfits.ch/23062009_1592895816AlltagsOutfit.png.png'
Downloaded '15011911_1547548476JACKandJONES.png' to '/data/backup/MaennerOutfits.ch/15011911_1547548476JACKandJONES.png.jpg'.....
```
This folder contains 5791 items (as seen in Cloudinary dashboard). And when I check local folder with downloaded images, that seems ok:
```
$ ls /data/backup/MaennerOutfits.ch/ | wc -l
5791```
However, when I check the size of this folder I get:
```
$ du -sh MaennerOutfits.ch/
392K MaennerOutfits.ch/```
Further inspection shows that in this folder there are no files larger than 1 byte
```
find MaennerOutfits.ch/ -type f -size +1c
```
Simple `ls -lah` confirms that:
```
-rw-r--r-- 1 blade blade 0 Sep 12 14:45 31121906_1577769565NaketanoPullover.png.jpg
```
I've tried uploading new images in this folder, without `.jpg.png` or `.png.png` ext, and this image gets downloaded correctly. That's how I concluded that this naming convention, which was done by mistake earlier in cms, was the problem. Images are OK in cloudinary folder, we got CDN links and everything works fine.. Just cli tool seems unable to download them :/
0 -
Hi Erwin, have you checked the cloud dir? What could be a problem?
What other options do I have to sync those directories?
0 -
Hi,
I apologize I missed your previous message and thank you for providing detail information.
Let me take a look your account and see if there is anything that could be causing the issue you described.Regards,
Erwin Lukas0 -
Hi,
Yes, there is appears to be a bug if the public id contains file extension as well. It tries to download the image with public id without the file extension.
Let me share this internally. In the mean time, if it's possible, remove the double extension. For resource_type image, the public id should not need to have the file extension.
Regards,
Erwin Lukas0 -
Renaming is not an option at the moment.. we have over 600k such images in other directories.
Please let me know as soon as you have some info how we could backup these images.
UPDATE: ok I figured out how to do bulk download with an admin api. Downside is that it downloads everything each time. So we're implementing fix to remove this double ext on all new uploads... Then, hopefully, we should be able to sync folders using cli.
0 -
Hi,
Apologies for the delayed reply.
Another way to bulk download your resources is to back them up to a private S3 bucket and then pull the data from their. Please see the below article for more information -
http://support.cloudinary.com/hc/en-us/articles/203744391-How-do-I-grant-Cloudinary-with-the-permissions-to-backup-on-my-private-S3-bucket-0 -
Hi,
Just want to update you that we have fixed the 0-byte issue for double extension asset on our CLI.
The following command now will pull the double extension file correctly.$ cld sync --pull ...
Can you upgrade to the latest version, give it a try, and let me know if it is still an issue for you?
Regards,
Erwin Lukas0
Post is closed for comments.
Comments
8 comments