[GH-ISSUE #1272] Random File permission issue #682

Closed
opened 2026-03-04 01:47:51 +03:00 by kerem · 6 comments
Owner

Originally created by @Genaker on GitHub (Apr 15, 2020).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1272

Additional Information

The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all.
Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD

Version of s3fs being used (s3fs --version)

Amazon Simple Storage Service File System V1.86 (commit:feafb44) with OpenSSL

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse)

fuse
2.9.2

Kernel information (uname -r)

4.14.171-136.231.amzn2.x86_64

GNU/Linux Distribution, if applicable (cat /etc/os-release)

NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

s3fs command line used, if applicable

Details about the issue

S3Fs randomly set root permissions to file. You can see
Warning: imagejpeg(/var/www/html/magento/pub/media/1/catalog/product/cache/d357e84f86ed455c69bdfd7bffd60977/w/t/wt04-purple_main_1.jpg): failed to open stream: Permission denied
content of the folder: the last file has root permission all files generated by the same PHP command

ls -l
total 116
-rw-rw-r-- 1 ec2-user ec2-user 6554 Apr 15 06:29 wt01-black_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6996 Apr 15 06:29 wt01-blue_back_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7045 Apr 15 06:29 wt01-blue_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6506 Apr 15 06:30 wt01-orange_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7291 Apr 15 06:30 wt02-green_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6834 Apr 15 06:30 wt02-orange_back_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7357 Apr 15 06:30 wt02-orange_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7144 Apr 15 06:30 wt02-yellow_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6694 Apr 15 06:30 wt03-orange_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6638 Apr 15 06:30 wt03-purple_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7729 Apr 15 06:31 wt03-red_alt1_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6619 Apr 15 06:31 wt03-red_back_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 6647 Apr 15 06:31 wt03-red_main_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 7951 Apr 15 06:31 wt04-blue_back_1.jpg
-rw-rw-r-- 1 ec2-user ec2-user 8704 Apr 15 06:31 wt04-blue_main_1.jpg
-rw-r----- 1 root root 8354 Apr 15 06:31 wt04-purple_main_1.jpg <-- random file with te root acces

Originally created by @Genaker on GitHub (Apr 15, 2020). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1272 ### Additional Information _The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all._ _Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD_ #### Version of s3fs being used (s3fs --version) Amazon Simple Storage Service File System V1.86 (commit:feafb44) with OpenSSL #### Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse, dpkg -s fuse) fuse 2.9.2 #### Kernel information (uname -r) 4.14.171-136.231.amzn2.x86_64 #### GNU/Linux Distribution, if applicable (cat /etc/os-release) NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/" #### s3fs command line used, if applicable ### Details about the issue S3Fs randomly set root permissions to file. You can see Warning: imagejpeg(/var/www/html/magento/pub/media/1/catalog/product/cache/d357e84f86ed455c69bdfd7bffd60977/w/t/wt04-purple_main_1.jpg): failed to open stream: Permission denied content of the folder: the last file has root permission all files generated by the same PHP command ls -l total 116 -rw-rw-r-- 1 ec2-user ec2-user 6554 Apr 15 06:29 wt01-black_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6996 Apr 15 06:29 wt01-blue_back_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7045 Apr 15 06:29 wt01-blue_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6506 Apr 15 06:30 wt01-orange_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7291 Apr 15 06:30 wt02-green_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6834 Apr 15 06:30 wt02-orange_back_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7357 Apr 15 06:30 wt02-orange_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7144 Apr 15 06:30 wt02-yellow_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6694 Apr 15 06:30 wt03-orange_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6638 Apr 15 06:30 wt03-purple_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7729 Apr 15 06:31 wt03-red_alt1_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6619 Apr 15 06:31 wt03-red_back_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 6647 Apr 15 06:31 wt03-red_main_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 7951 Apr 15 06:31 wt04-blue_back_1.jpg -rw-rw-r-- 1 ec2-user ec2-user 8704 Apr 15 06:31 wt04-blue_main_1.jpg -rw-r----- 1 root root 8354 Apr 15 06:31 wt04-purple_main_1.jpg <-- random file with te root acces
kerem 2026-03-04 01:47:51 +03:00
  • closed this issue
  • added the
    need info
    label
Author
Owner

@haywiremk commented on GitHub (Apr 28, 2020):

Having a similar issue via apache www-data user. Sometime is will write files with root only permissions with no rw flags.

Using ubuntu LTS 18.04.4 repo version
Package: s3fs
Version: 1.82-1
Priority: optional
Section: universe/utils
Source: s3fs-fuse
Origin: Ubuntu

<!-- gh-comment-id:620751679 --> @haywiremk commented on GitHub (Apr 28, 2020): Having a similar issue via apache www-data user. Sometime is will write files with root only permissions with no rw flags. Using ubuntu LTS 18.04.4 repo version Package: s3fs Version: 1.82-1 Priority: optional Section: universe/utils Source: s3fs-fuse Origin: Ubuntu
Author
Owner

@iDiogenes commented on GitHub (Apr 29, 2020):

I am using the same version as @haywiremk and am seeing the same issue. Furthermore, any data added to S3 for other sources has zeros out the permissions and has root be the owner. It is then impossible to change the permissions to access the data.

<!-- gh-comment-id:620998815 --> @iDiogenes commented on GitHub (Apr 29, 2020): I am using the same version as @haywiremk and am seeing the same issue. Furthermore, any data added to S3 for other sources has zeros out the permissions and has root be the owner. It is then impossible to change the permissions to access the data.
Author
Owner

@iDiogenes commented on GitHub (Apr 30, 2020):

@haywiremk - The issue is the version of s3fs that comes in the apt repo. Just compile from source and you will be good.

<!-- gh-comment-id:621603574 --> @iDiogenes commented on GitHub (Apr 30, 2020): @haywiremk - The issue is the version of s3fs that comes in the apt repo. Just compile from source and you will be good.
Author
Owner

@Genaker commented on GitHub (May 5, 2020):

@haywiremk I have compiled from the sources and it has this issue. Randomly permissions sites to root.

<!-- gh-comment-id:624219714 --> @Genaker commented on GitHub (May 5, 2020): @haywiremk I have compiled from the sources and it has this issue. Randomly permissions sites to root.
Author
Owner

@gaul commented on GitHub (Jul 26, 2020):

Could you use the AWS CLI to compare the metadata of an object with the expected and unexpected permissions via:

$ aws s3api head-object --bucket $YOUR_BUCKET --key $YOUR_KEY
{
    "AcceptRanges": "bytes",
    "LastModified": "Sun, 26 Jul 2020 07:21:13 GMT",
    "ContentLength": 0,
    "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
    "ContentType": "application/octet-stream",
    "Metadata": {
        "ctime": "1595748072",
        "mode": "33204",
        "gid": "1000",
        "uid": "1000",
        "mtime": "1595748072"
    },
    "StorageClass": "STANDARD_IA"
}
<!-- gh-comment-id:663950564 --> @gaul commented on GitHub (Jul 26, 2020): Could you use the AWS CLI to compare the metadata of an object with the expected and unexpected permissions via: ``` $ aws s3api head-object --bucket $YOUR_BUCKET --key $YOUR_KEY { "AcceptRanges": "bytes", "LastModified": "Sun, 26 Jul 2020 07:21:13 GMT", "ContentLength": 0, "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "ContentType": "application/octet-stream", "Metadata": { "ctime": "1595748072", "mode": "33204", "gid": "1000", "uid": "1000", "mtime": "1595748072" }, "StorageClass": "STANDARD_IA" } ```
Author
Owner

@gaul commented on GitHub (Aug 16, 2020):

Please reopen if you can provide the requested debugging info.

<!-- gh-comment-id:674499662 --> @gaul commented on GitHub (Aug 16, 2020): Please reopen if you can provide the requested debugging info.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#682
No description provided.