Problems uploading package (how can I debug this thing?)
I am getting the following error when I have created a package with a lot of files. I think I may be missing files somewhere but am unsure where.
What is the best way to debug this?
Could not upload file System.Exception: Error
unpacking extension... ---> System.IndexOutOfRangeException: Index
was outside the bounds of the array.
at umbraco.cms.businesslogic.packager.Installer.getFileName(String
path, String fileName)
at umbraco.cms.businesslogic.packager.Installer.LoadConfig(String
tempDir)
at umbraco.cms.businesslogic.packager.Installer.Import(String
InputFile)
--- End of inner exception stack trace ---
at umbraco.cms.businesslogic.packager.Installer.Import(String
InputFile)
at
umbraco.presentation.developer.packages.Installer.uploadFile(Object
sender, EventArgs e)
For debugging errors in Umbraco, I have a copy of the latest version of Umbraco from codeplex so that I can look at the source for the methods that re throwing errors, it helps me to spot what's causing the problem.
Unzip the file and look at the package.xml file, which is the manifest for the package. It will list all the files to be installed. Any whacko filenames? Are all the files actually in the zip file?
Thanks guys, there are a lot of files in the package so it will take a while to go through it. I think it is missing a file going by the error it would be good to know what file it was. If the file name was included in the error it would be really useful.
Just finsihed going through each file (managed to get rid of all the svn files) and all are in the package directory. Not sure where to go next with this.
If you unzip'd the original package, have added/removed files, updated the package.xml file so that everything is in sync now, you can manually re-zip the guid folder and its contents and have a package ready for using with umbraco.
If you still have problems with the package installing you might break the package into multiple parts to find the relevant bit that isn't working properly.
I got to the bottom of this issue here is what I done to find out the problem:
1. Downloaded the source of the version of umbraco that was causing issues 2. Set up an IIS Website to point to the presentation folder of the source and set appropriate permissions 3. Opened the solution and built it 4. In the solution attached IIS to the w3wp.exe process to allow me to debug 5. Made sure break on all errors was switched on in Visual Studio (http://forum.jamesfoxall.com/showthread.php?t=676) 6. In umbraco logged into the admin section and tried to upload my package
After a bit of debugging I traced the error back to a file I had included in the package from the root of the website.
Have a look at the extract from the package.xml that was causing problems notice <orgPath /> notice doesn't contain anything.
Problems uploading package (how can I debug this thing?)
I am getting the following error when I have created a package with a lot of files. I think I may be missing files somewhere but am unsure where.
What is the best way to debug this?
Hi Brendan,
How many files are in the package?
For debugging errors in Umbraco, I have a copy of the latest version of Umbraco from codeplex so that I can look at the source for the methods that re throwing errors, it helps me to spot what's causing the problem.
A shot in the dark...
Unzip the file and look at the package.xml file, which is the manifest for the package. It will list all the files to be installed. Any whacko filenames? Are all the files actually in the zip file?
Let us know what you find.
cheers,
doug.
Thanks guys, there are a lot of files in the package so it will take a while to go through it. I think it is missing a file going by the error it would be good to know what file it was. If the file name was included in the error it would be really useful.
There are a pile of svn-base files that are included out of somewhere anyone see them before?
Hi Doug,
Just finsihed going through each file (managed to get rid of all the svn files) and all are in the package directory. Not sure where to go next with this.
Any ideas?
Thanks for the help,
B
If you unzip'd the original package, have added/removed files, updated the package.xml file so that everything is in sync now, you can manually re-zip the guid folder and its contents and have a package ready for using with umbraco.
If you still have problems with the package installing you might break the package into multiple parts to find the relevant bit that isn't working properly.
Let us know what you find out.
cheers,
doug.
I got to the bottom of this issue here is what I done to find out the problem:
1. Downloaded the source of the version of umbraco that was causing issues
2. Set up an IIS Website to point to the presentation folder of the source and set appropriate permissions
3. Opened the solution and built it
4. In the solution attached IIS to the w3wp.exe process to allow me to debug
5. Made sure break on all errors was switched on in Visual Studio (http://forum.jamesfoxall.com/showthread.php?t=676)
6. In umbraco logged into the admin section and tried to upload my package
After a bit of debugging I traced the error back to a file I had included in the package from the root of the website.
Have a look at the extract from the package.xml that was causing problems notice <orgPath /> notice doesn't contain anything.
Here is a snippet of the code that falls over (umbraco.cms.businesslogic.packager.Installer)
private static String getFileName(String path, string fileName)
{
Debug.Assert(path != null && path.Length >= 1);
Debug.Assert(fileName != null && fileName.Length >= 1);
path = path.Replace('/', '\\');
fileName = fileName.Replace('/','\\');
// Does filename start with a slash? Does path end with one?
bool fileNameStartsWithSlash = (fileName[0] == Path.DirectorySeparatorChar);
bool pathEndsWithSlash = (path[path.Length-1] == Path.DirectorySeparatorChar);
// Path ends with a slash
if (pathEndsWithSlash)
{
if(!fileNameStartsWithSlash)
// No double slash, just concatenate
return path + fileName;
else
// Double slash, exclude that of the file
return path + fileName.Substring(1);
}
else
{
if (fileNameStartsWithSlash)
// Required slash specified, just concatenate
return path + fileName;
else
// Required slash missing, add it
return path + Path.DirectorySeparatorChar + fileName;
}
}
An empty string is passed in as the path as the file belong to the root of the website.
This looks like a bug with the above method how do I go about raising it?
Nice job tracking this down!
For now, the workaround would be to add a path to the file, even if it is just "/"
cheers,
doug.
Comment author was deleted
Thanks for the details, should be fixed in 4.6 (Juno)
Nice one Tim
is working on a reply...