Image gallery error

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
3/16/2009 7:51:11 PM
Gravatar
Total Posts 5

Re: Image gallery error

Hi Joe,

fist off all thanks for the cool portal ....

I'm also try to install a site on godaddy to get the mojo Portal running, I'm thinking I'm at the same stage like Valzero, did the same same steps, exept the Lucene.Net.lockdir entry, which I din't change so far. However beside the VirtualPathProvider-exception, I have also the following enty. the upload is working, also the other gallery (writing into the GalleryImages is working), the error is in the case that some images are in FolderGalleries and I thing it while they want to create the thumbnails (in the GalleryImages where created succesfully) ... do you have any ideas.

@Valzero: thanks for the detailed descriptions of the steps, which I have done independently. Did you get the FolderGalleries running in the meantime? You portal look really good.

BR
Volker
Here my exeption:

2009-03-16 16:04:11,624 ERROR mojoPortal.Web.mojoBasePage - 77.56.59.125-de-CH - /mojo/fotos-simple.aspx
System.Reflection.TargetInvocationException: Property accessor 'Link' on object 'mojoPortal.Web.Controls.FolderGallery.AlbumFolderInfo' threw the following exception:'The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception.' ---> System.TypeInitializationException: The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Web.Controls.FolderGallery.ImageHelper..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
MyComputer
--- End of inner exception stack trace ---
at mojoPortal.Web.Controls.FolderGallery.ImageHelper.JScriptEncode(String unencoded)
at mojoPortal.Web.Controls.FolderGallery.AlbumPageInfo.get_Link()
--- End of inner exception stack trace ---
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName)
at System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts)
at System.Web.UI.DataBinder.Eval(Object container, String expression)
at System.Web.UI.TemplateControl.Eval(String expression)
at ASP.foldergallery_foldergallerymodule_ascx.__DataBinding__control9(Object sender, EventArgs e)
at System.Web.UI.Control.OnDataBinding(EventArgs e)
.....
at mojoPortal.Web.mojoBasePage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2009-03-16 16:04:11,827 ERROR mojoPortal.Web.Global - 77.56.59.125-de-CH - /mojo/fotos-simple.aspx
System.TypeInitializationException: The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Web.Controls.FolderGallery.ImageHelper..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The Zone of the assembly that failed was:
MyComputer
--- End of inner exception stack trace ---
at mojoPortal.Web.Controls.FolderGallery.ImageHelper.JScriptEncode(String unencoded)
at mojoPortal.Web.Controls.FolderGallery.AlbumPageInfo.get_Link()
 

3/17/2009 5:43:18 AM
Gravatar
Total Posts 16

Re: Image gallery error

Yes the image gallery is working on godaddy. I made a folder using an ftp client and uploaded the pictures there. Then I started uploading pictures using mojoportal 1 by 1. You are not able to upload multiple pictures. I am very happy to see that someone was able to get mojoportal running with my messy notes!!!! They are nothing but joe's responses in a specific order.

You have to use image gallery the simple image gallery does not work probably something about running on medium trust.

I hope this helps with your image gallery error. You can see the godaddy image gallery working on godaddy on this link http://www.brickellinvestmentrealty.com/birmiami/bristol-condo.aspx

P.S. I am not able to help debug your logged error message because I am not a designer a programmer or anything like that.

3/17/2009 4:22:12 PM
Gravatar
Total Posts 5

Re: Image gallery error

Hi Valzero,

ohh, I think I have to dissapoint you, I didn't get the portal running with you notes. I did it without your description, however I saw afterwords by searching here in the forums, that this describe exacly what I have done so far ;-). Its a good start to get task list for install it on godaddy. I have also the image gallery running and I can also upload the images there, but this doesn't support sub folders. That the reason, why I want to get the other running. The folder image gallery works a long it has no uploaded images. If I upload the images (the upload is working) or copy images into the portal with FTP, I'm getting the error. The errors says to me that the it get an error (FileIOPermission) while creating a folder (I guess it is while it created the thumbnails). But I cannot figure out why or where this folder should be created, the /Data is read/write (beside app_data), and also the other image gallery is creating successfully images for the thumbnails (and directories for it). I have the feeling it is not pointing inside the /Data directory perhaps some temp or something like that .... I have no other ideas.

BR
Volker

3/17/2009 9:12:09 PM
Gravatar
Total Posts 16

Re: Image gallery error

I wonder what that page is supposed to look like? Is it a better gallery? If so is worth having. If not you can just have links on the left pointing at different pages within the same page and all of them running a different image gallery. Search for the post for ALT 1 and ALT 2 fields they cover the whole with of the site and look fantastic for header/footer pieces. The 3 column format gets boring fast. Joe wrote a post about it that plays it down a bit, but I think is great feature.

P.S. thanks for pissing on my good deed for the day. Now I have to go do some voluntary work or I wont be able to sleep .

You can barely tell that we do not speak english in daily basis.

3/18/2009 6:49:05 AM
Gravatar
Total Posts 18409

Re: Image gallery error

Hi Guys,

When I test on my local machine under Medium Trust, the folder gallery works just fine. It creates its thumbnails and medium size images in the folder /Data/systemfiles/FolderGalleryCache

So as long as it can create files and folders beneath /Data it should not be a problem with write permission.

I wonder, when you upload files via ftp, do the files have different permissions on them? I would make sure they are readable by the web process identity user.

Hope it helps,

Joe

3/18/2009 12:57:34 PM
Gravatar
Total Posts 5

Re: Image gallery error

Hi Joe,

I checked it, but I cannot find this directory, neither systemfiles nor FolderGalleryCache below. I guess this will be created normally by the process. About the Data directory, I doble checked this and made again "Reset all children to inherit", this dosn't help. I navigated also to the directoy where I uploaded the files, it is read/write (With the goddy tool you cannot see the permissions on file level. I don't think that this is the problem, normally this should be inherit from the folder). Anyway, I uploaded all files with the upload function from web portal to be sure, so I can be sure that the file created by the ASPNET process, this one should be readable. I have also created the directory /Data/systemfiles/FolderGalleryCache in the application root (in my case 'mojo') manually. Also checked here the file permissons that it is read write. Nothing helps. Do you have still any ideas, what it could be?

Volker 

3/18/2009 1:11:08 PM
Gravatar
Total Posts 18409

Re: Image gallery error

 Do you have these settings in your Web.config file:

<add key="FolderGalleryRequiredPath" value="FolderGalleries" />
<add key="FolderGalleryCachePath" value="/Data/systemfiles" />

Hope it helps,

Joe

 

3/18/2009 3:27:08 PM
Gravatar
Total Posts 5

Re: Image gallery error

Yes, I have this enties. So far my web.config is the original web.config for medium trust, just renamed. The DB entries are in the user.config.
(fyi: I have the version 2.2.9.2 MSSQL)

4/5/2009 8:46:23 AM
Gravatar
Total Posts 18409

Re: Image gallery error

Hi knoess,

2009-03-16 16:04:11,624 ERROR mojoPortal.Web.mojoBasePage - 77.56.59.125-de-CH - /mojo/fotos-simple.aspx
System.Reflection.TargetInvocationException: Property accessor 'Link' on object 'mojoPortal.Web.Controls.FolderGallery.AlbumFolderInfo' threw the following exception:'The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception.' ---> System.TypeInitializationException: The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Web.Controls.FolderGallery.ImageHelper..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission

The error seems to indicate insufficient permission to create the folder /Data/systemfiles/FolderGalleryCache

Its attempting to create it in the constructor of ImageHelper

if (Caching == ImageCacheLocation.Disk)
{
if (
(HttpContext.Current != null)
&&(ConfigurationManager.AppSettings["FolderGalleryCachePath"] != null)
)
{
string baseDir = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["FolderGalleryCachePath"]);

_imageCacheDir = Path.Combine(baseDir, "FolderGalleryCache");


}
else
{

_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "Album");
}


Directory.CreateDirectory(_imageCacheDir);
_appPath = HttpRuntime.AppDomainAppPath;
if (_appPath[_appPath.Length - 1] == '\\')
{
_appPath = _appPath.Substring(0, _appPath.Length - 1);
}
}

I believe the line where it throws this exception is:

Directory.CreateDirectory(_imageCacheDir);

So it seems clear the web process cannot create this folder, it does not have permission. So the solution must be to give it permission to create folders beneath /Data/systemfiles

I will add code there in the next release to check if the directory exists first so that we can possibly avoid this error if the folder is created manually.

Hope it helps,

Joe

 

 

4/5/2009 12:20:40 PM
Gravatar
Total Posts 5

Re: Image gallery error

Hi Joe,

thanks for your research. Yes thats points into the right direction. In the meantime, I've got the mojoPortal also running on my local computer and I found the problem. My portal is running in a separate directory not in the root, so the configuration in your web.config is pointing to a directory outside from my mojo portal application. So it's clear that the access is not allowed. The solution is quit easy only one character to add "~" ;-) 

<add key="FolderGalleryCachePath" value="~/Data/systemfiles" />

Best Regards
Volker

You must sign in to post in the forums. This thread is closed to new posts.