How can I change folder or file permissions when mount in Azure storage service?

OH KYOON KWON 21 Reputation points
2020-09-09T05:02:39.983+00:00

Please..Waiting for your earnest answers.

My development environment is Azure cloud - Kubernetes and I want to install the Gitlab Docker image in Azure's storage service.

Look at the log below, Gitlab starts up and tries to change the permissions of Azure storage, but Azure storage does not allow this.

Eventually, Gitlab cannot be started.

I tried changing the mount option when loading Kubernetes' StorageClass, pv, and pvc, but couldn't apply it.

Please answer for this..

================================================================================ Error executing action create on resource 'storage_directory[/var/opt/gitlab/.ssh]' ================================================================================

Mixlib::ShellOut::ShellCommandFailed

------------------------------------ ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of chmod 00700 /var/opt/gitlab/.ssh ---- STDOUT: STDERR: chmod: changing permissions of '/var/opt/gitlab/.ssh': Operation not permitted ---- End output of chmod 00700 /var/opt/gitlab/.ssh ---- Ran chmod 00700 /var/opt/gitlab/.ssh returned 1 Cookbook Trace: --------------- /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:35:in run_command' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:55:inensure_permissions_set' /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:40:in block (3 levels) in class_from_file' Resource Declaration: --------------------- # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb 34: storage_directory dir do 35: owner git_user 36: group git_group 37: mode "0700" 38: end 39: end Compiled Resource: ------------------ # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-shell.rb:34:inblock in from_file' storage_directory("/var/opt/gitlab/.ssh") do action [:create] default_guard_interpreter :default declared_type :storage_directory cookbook_name "gitlab" recipe_name "gitlab-shell" owner "git" group "git" mode "0700" path "/var/opt/gitlab/.ssh" end System Info: ------------ chef_version=14.14.29 platform=ubuntu platform_version=16.04 ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux] program_name=/opt/gitlab/embedded/bin/chef-client executable=/opt/gitlab/embedded/bin/chef-client Running handlers: There was an error running gitlab-ctl reconfigure: storage_directory[/var/opt/gitlab/.ssh] (gitlab::gitlab-shell line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: ruby_block[directory resource: /var/opt/gitlab/.ssh] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 34) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of chmod 00700 /var/opt/gitlab/.ssh ---- STDOUT: STDERR: chmod: changing permissions of '/var/opt/gitlab/.ssh': Operation not permitted ---- End output of chmod 00700 /var/opt/gitlab/.ssh ---- Ran chmod 00700 /var/opt/gitlab/.ssh returned 1 Running handlers complete Chef Client failed. 7 resources updated in 07 seconds

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,223 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,146 questions
0 comments No comments
{count} votes

Accepted answer
  1. deherman-MSFT 37,416 Reputation points Microsoft Employee
    2020-09-09T16:07:13.837+00:00

    @OH KYOON KWON
    Mounting Azure Files on Linux utilizes CIFS. As such the files permission on CIFS filesystems cannot be changed post mount. I found this post very helpful in explaining this.

    Alternatively you might consider trying Blob storage. Either using NFS 3.0 or blobfuse to mount.

    I hope this information is helpful to you. If you have further questions or issues please let us know.

    Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    -------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.