First Orchard Deployment Attempt = Illegal characters in path Error

Topics: Installing Orchard
Apr 6, 2011 at 3:19 PM
Edited Apr 6, 2011 at 3:21 PM

Good Morning All:

When I ran Orchard in my hosting environment for the first time, I recieved the below error. 

Here's what I did..   I installed it to my local pc and sql server using the Web Platform Installer, then I uploaded the site over FTP to the cloud.  I also restored the database to the cloud and changed the connection string in the App_Data/Sites/Default/settings.txt file, which seems to be the root of my problem.  Illegal characters in path.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.



 

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentException: Illegal characters in path.]
   System.IO.Path.CheckInvalidPathChars(String path) +126
   System.IO.Path.Combine(String[] paths) +84
   Orchard.FileSystems.AppData.AppDataFolder.Combine(String[] paths) in AppDataFolder.cs:90
   Orchard.Data.SessionFactoryHolder.GetSessionFactoryParameters() in SessionFactoryHolder.cs:108
   Orchard.Data.SessionFactoryHolder.BuildConfiguration() in SessionFactoryHolder.cs:79
   Orchard.Data.SessionFactoryHolder.GetConfiguration() in SessionFactoryHolder.cs:62
   Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in SessionFactoryHolder.cs:74
   Orchard.Data.SessionFactoryHolder.GetSessionFactory() in SessionFactoryHolder.cs:53
   Orchard.Data.SessionLocator.For(Type entityType) in SessionLocator.cs:29
   Orchard.Data.Repository`1.get_Session() in Repository.cs:26
   Orchard.Data.Repository`1.get_Table() in Repository.cs:30
   Orchard.Data.Repository`1.Fetch(Expression`1 predicate) in Repository.cs:126
   Orchard.Data.Repository`1.Get(Expression`1 predicate) in Repository.cs:91
   Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Get(Expression`1 predicate) in Repository.cs:60
   Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetDescriptorRecord() in ShellDescriptorManager.cs:52
   Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetShellDescriptor() in ShellDescriptorManager.cs:25
   Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings) in ShellContextFactory.cs:66
   Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings settings) in DefaultOrchardHost.cs:128
   Orchard.Environment.DefaultOrchardHost.<CreateAndActivate>b__1(ShellSettings settings) in DefaultOrchardHost.cs:100
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +85
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +217
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +78
   Orchard.Environment.DefaultOrchardHost.BuildCurrent() in DefaultOrchardHost.cs:88
   Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in DefaultOrchardHost.cs:56
   Orchard.Web.MvcApplication.Application_Start() in Global.asax.cs:22

[HttpException (0x80004005): Illegal characters in path.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9028953
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253

[HttpException (0x80004005): Illegal characters in path.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
 
So, I added this logging statement:
 
for (int i = 0; i < paths.Length; i++ )
{
 Logger.Debug(String.Format("paths[{0}]:{1}", i,paths[i]));
}

 And, got the following output:

 2011-04-06 09:00:37,229 [15] Orchard.FileSystems.AppData.AppDataFolder - paths[0]:Sites

 

 

 

DataConnectionString: Data Source=****;Initial Catalog=****;Persist Security Info=True;User ID=****;Password=****

 

DataPrefix: null

RequestUrlHost: null

RequestUrlPrefix: null

State: Running

EncryptionAlgorithm: AES

EncryptionKey: ****

HashAlgorithm: HMACSHA256

HashKey: ****

 **** = Removed for security :)

 

 

 

 

And I found that the whole file is being read into the Name variable.. 

The solution was to upload the settings.txt as Binary, to preserve the text file format.. (I was using FileZilla so it probably transmitted the file as ASCII) .... 

I recommend that these .txt files are switch to .xml files as parsing an xml document does not rely on the carriage returns in the file..  An XML file would be less succeptible to this sort of corruption via ftp transfer, and an install won't require debugging skills, or reading my post.

Thanks!

I'm super excited to build our first Orchard site!!

Rob

 

 

 

2011-04-06 09:00:37,229 [15] Orchard.FileSystems.AppData.AppDataFolder - paths[1]:Default

DataProvider: SqlServer

Coordinator
Apr 6, 2011 at 5:58 PM

Oh, interesting. Can you please file a bug?

May 5, 2011 at 8:05 PM

I have a similar error (also using Filezilla to deploy) but am a bit confused with the "d:\teamcity..." reference in the "Illegal character..." error below:

Illegal characters in path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[ArgumentException: Illegal characters in path.]
   Orchard.WarmupStarter.Starter.OnBeginRequest(HttpContext context, Action`1 registrations) in d:\TeamCity\Projects\Orchard-Default\src\Orchard.Startup\Starter.cs:20
   Orchard.Web.MvcApplication.Application_BeginRequest() in C:\Programmering\programmeramera.se\Orchard.Web.1.1.30\Orchard\Global.asax.cs:24

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
   System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +57
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Coordinator
May 5, 2011 at 9:35 PM

(you can ignore the teamcity thing: that is just the full path of the source files for the machine where the build was made and it has no impact at all at runtime.)

Can you give more details about what exactly you did that led to this error?

May 6, 2011 at 5:11 AM

I have created a local Orchard installation with WebMatrix, running perfectly on my local computer. That directory is then uploaded to a hoster which claims to be running IIS 7.5 and apparently .NET Framework 4.0. That is pretty much it...

Coordinator
May 6, 2011 at 5:17 AM

I'm sorry, I don't know. I'm using FileZilla myself to deploy my own web site so it can't be the problem.

May 6, 2011 at 7:55 AM

I tried to deplay using WebMatrix instead, and now it works perfectly. I'm guessing that I had the "not binary" option in FileZilla giving me a bad time as well...

Coordinator
May 6, 2011 at 7:56 AM

Haha! Yes, that would explain it :)

May 6, 2011 at 2:17 PM

FileZilla isn't the problem.. just be sure the Transfer Type in the Transfer menu is set to "Binary" instead of Auto.  This could happen with many ftp clients.