Nopcommerce: Installation failed when run on mac

Created on 29 Apr 2019  路  8Comments  路  Source: nopSolutions/nopCommerce

nopCommerce version:
nopCommerce_4.20_Beta_Source

Steps to reproduce the problem:

  1. start the project and go to installation page
  2. Enter Installation Info
  3. after click installation rasie error below

The 'macs-mbp\mac' account is not granted with Modify permission on folder '/Users/mac/Downloads/nopCommerce_4.20_Beta_Source/Presentation/Nop.Web/App_Data'. Please configure these permissions.

bug

Most helpful comment

  • Tested and was able to verify @bzass 's suggestion for the Mac OSX specific permission command on Mac (Mojave)
  • Implemented the Mac OSX check and Mac OSX specific permissions check
  • Submitted as PR: #3793
  • All credits for @bzass 馃憤 :)

All 8 comments

I guess you have to give the required rights to the specified folder (App_Data)

I guess you have to give the required rights to the specified folder (App_Data)

this problem was in the previous version too , and it must solved at that version based on last update. it suppose it support linux

The error message is self-descriptive. You should properly configure specified permissions

I think installation failure was due to the method CheckPermissionsInUnix within FilePermissionHelper.cs, MACOS file permission was not handled properly, it could be due to shell access permission...

I did a quick bypass, installation went well.

Hi @RomanovM , faced the same issue while trying to test nopCommerce v4.20-beta on (Visual Studio for) Mac, even after I granted chmod -R 777 on complete Nop.Web folder... would you be so kind to briefly describe how to grant what permissions exactly on Mac? tx

I came across the same. The problem was that in FilePermissionsHelper.cs / CheckPermissionsInUnix method we are using stat -c Unix command. Mac is using a bit different version of a stat, where -c argument doesn't exist. Instead, you can use -f with slightly modified parameters to get expected results. Below is the code that I modified to work around this problem. We could make a note in docs about that or think about a different, cross-platform way of checking file permissions (something that native .NET Core classes provide?). We could also add code checking $OSTYPE and based on result - choose the proper version of stat arguments.

                StartInfo = new ProcessStartInfo
                {
                    RedirectStandardInput = true,
                    RedirectStandardOutput = true,
                    UseShellExecute = false,
                    FileName = "sh",
                    // Arguments = $"-c \"stat -c '%a %u %g' {path}\""
                    Arguments = $"-c \"stat -f '%A %u %g' {path}\""
                }
  • Tested and was able to verify @bzass 's suggestion for the Mac OSX specific permission command on Mac (Mojave)
  • Implemented the Mac OSX check and Mac OSX specific permissions check
  • Submitted as PR: #3793
  • All credits for @bzass 馃憤 :)

Closed #3736

Was this page helpful?
0 / 5 - 0 ratings