nbrightproject / NBrightBuy

NBrightStore - E-Commerce for DNN (NBSv3)
http://www.nbrightproject.org/
21 stars 15 forks source link

Access to the path '/Portals/0/NBStore' is denied #60

Closed jftsaraiva closed 7 years ago

jftsaraiva commented 7 years ago

In a new installation, following DNN8 Basic Setup from http://nbsdocs.nbrightproject.org/Documentation/Downloads.aspx when I save my Admin > Setting always get:

Access to the path '/Portals/0/NBStore' is denied.

The form data is saved but the message Store Configuration needs to be done. is always there and the directory /Portals/0/NBStore doesn't exist.

Even if I created NBStore Directory in 'File Management' - and this works fine - I'm getting the same error.

This is probably something with permissions, but I'm in Azure and don't know which one. Any suggestion?

Full event log message:

AbsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:d4c4203c-eef0-4d4a-b13e-055c3bb8022b
AssemblyVersion:8.0.4
PortalId:0
UserId:1
TabId:429
RawUrl:/Store
Referrer:http://xxxxxxxxxxx.azurewebsites.net/Store
UserAgent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
ExceptionHash:Wgm62z54aPCjkVwamQGLJQ==
Message:Access to the path '/Portals/0/NBStore' is denied.
StackTrace:
InnerMessage:Access to the path '/Portals/0/NBStore' is denied.
InnerStackTrace:
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at System.IO.Directory.CreateDirectory(String path)
   at Nevoweb.DNN.NBrightBuy.Admin.Settings.Update()
   at Nevoweb.DNN.NBrightBuy.Admin.Settings.CtrlItemCommand(Object source, RepeaterCommandEventArgs e)
   at System.Web.UI.WebControls.Repeater.OnItemCommand(RepeaterCommandEventArgs e)
   at System.Web.UI.WebControls.Repeater.OnBubbleEvent(Object sender, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.RepeaterItem.OnBubbleEvent(Object source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
   at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
hpkrekt commented 7 years ago

I have the same problem and have also DNN installed on Azure. Any suggestion to solve this problem are welcomed.

leedavi commented 7 years ago

My guess is this is permissions issue. I've not got much experience with hosting on Azure, but I don't think I'm doing anything special with file system access, so if DNN is working I'm not sure why NBS is not. Check all your file system permissions.

nicpitsch commented 7 years ago

I have the same problem and error message, but on a VPS (Windows Server 2012). I double checked in IIS that NETWORK SERVICE has Modify permissions and that it is the Identity of the DefaultAppPool, which i use for the Site. DefaultAppPool is Integrated pipline mode and .NET CLR Version v4.0xxx. Also i can confirm that the Portal is a Site Type (and not a Child Portal) and that .NET Framework 4.6 is installed.

Another extension i use also creates subfolders on the portal with no problems.

On my local machine i am able to setup NBStore according to the DNN8 Basic Setup with no problem.

leedavi commented 7 years ago

Hi, this sounds very similar to the setup I use. So I would expect it to work!!

The only difference I have is that I usually just give full permission to the Network Service group. You could try that and see if it works OK.

The only other possiblity I can think (which has happen to me before) is that for some reason when saving the store admin settings not all the correct folder got created. Although I seem to recall a different error message for that.

But check what folders you have under the NBStore folder. i would expect to see "docs","images","uploads" by default. There should also be a NBSTemp folder under portal root. But these folders shoudl match the names in the BO>Admin>Settings.

If they don't exist, try saving the setting again and see if they get created.

leedavi commented 7 years ago

NOTE: If you have issues with images not uploading correctly, you can use BO>Tools>Validate Store to ensure the settings are activated correctly.

nicpitsch commented 7 years ago

Hello, the folders don't get created when saving the Configuration. Therefore i already tried before to create them, also to register them with DNN File Management. No success.

I tried again with a fresh DNN8 installation:

2016-10-15_13-49-15

Event Viewer: AbsoluteURL:/Default.aspx DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:bc5fa6e8-188e-44a0-a145-3a7af5f4916c AssemblyVersion:8.0.4 PortalId:0 UserId:1 TabId:83 RawUrl:/Admin/NBS-Back-Office Referrer:http://xxxx.ch/Admin/NBS-Back-Office UserAgent:Mozilla/5.0 (Windows NT 6.3; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 ExceptionHash:Khqk8/ul9SjY97rQwecqpw== Message:Access to the path '/Portals/0/NBStore' is denied. StackTrace: InnerMessage:Access to the path '/Portals/0/NBStore' is denied. InnerStackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at Nevoweb.DNN.NBrightBuy.Admin.Settings.Update() at Nevoweb.DNN.NBrightBuy.Admin.Settings.CtrlItemCommand(Object source, RepeaterCommandEventArgs e) at System.Web.UI.WebControls.Repeater.OnItemCommand(RepeaterCommandEventArgs e) at System.Web.UI.WebControls.Repeater.OnBubbleEvent(Object sender, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.RepeaterItem.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Source: FileName: FileLineNumber:0 FileColumnNumber:0 Method: Server Name: xxxxx

leedavi commented 7 years ago

OK, can you create folders wirth the DNN file manger? Or do you get an error there as well?

nicpitsch commented 7 years ago

I can create them with the file manager with no error.

leedavi commented 7 years ago

OK, I'm a little unsure what this could be! I do recall, in the past, DNN having to do something special with the file system to overcome a security issue, but I'm not sure what and I'm unsure what it did to solve it. I've never had a problem.

I'm using the standard .Net file operations for NBS, so I'm unsure why it's shoudln;t work if the permisisons are OK, which I assume they are if DNN can create folders.

I'll ask around and see if anyone can offer a reason!

leedavi commented 7 years ago

The only thing I can suggest as a idea would be to create another app pool dedictaed to this install and then applu full permissions for the app pool onto the file system and see if that works.

nicpitsch commented 7 years ago

I did try with a separate app pool. No chance, allways that error.

Why does this error stay also after creation of the NBS folders with DNN file manager?

leedavi commented 7 years ago

The error appears because although the folder exist, for some reason NBS doesn't have security rights to access them. So I'm fairly sure it's a permissions issue, but from what you tell me of the setup I don't know what.

If you can allow me access to the server with RDP I could take a look to see if I can understand why, Send me a PM with a login if you can.

leedavi commented 7 years ago

Just checking the DNN code and they are using the same System.IO.Directory class as me in NBS.

Have you checked that the permissions have cascaded to ALL the sub-folders correctly?

nicpitsch commented 7 years ago

Thanks. How respectively where can i send you a PM?

leedavi commented 7 years ago

I can;t find the PM system on GitHub either!

leedavi commented 7 years ago

This issue is fixed in v3.5.1.11, you can download the fix form DNN Store.