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)
I have isolated the problem, but I do not know why the error happens.
Must be something in the xml then, weird one maybe a character. I use this action in many packages without an issue. What you should do is use the package action tester
http://our.umbraco.org/projects/developer-tools/package-action-tester and run in debug mode to see what is going on.
I have copy the action class AddXmlFragment.cs in a new clean visual studio project with umbraco 7.2.1 and have set a breakpoint to Execute - Function. But the function is not reached in this scenario. If I remove this line <filevalue="App_Data\Logs\mail2cms.log.txt"/> from my package actions I can install the package after loading and the function is reached and all works great.
But the error occurs if I click on "Load package" and due to the error I have not the possibility to install the package. Because that, the "Execute" function is not calling.
Can you or everyone check if you can execute the package action from my first post above and if the log4net.config is updated after this? I would like to know if the problem is only with me or if anyone else has the same problem with this specific code. As I said, it works great without the row with the file tag...
I have tested now again.If I call the complete package action with Package Action Tester it works now. Maybe the log4net.config file was not loaded properly in editor again at yesterday.But this works!
Now I have changed this line
<filevalue="App_Data\Logs\mail2cms.log.txt"/>
to
<fileTestvalue="App_Data\Logs\mail2cms.log.txt"/>
And with this I can load and install the package.
It seems that umbraco package installer has a problem on loading the package, if the tag <file> is included in AddXmlFragment package actions.
I have removed the actions for log4net from package actions and included the most of your source files directly in my mail2cms solution. Then I insert this actions hardcoded and call the PackageActionService.ExecutePackageActions(executeModel) Function in my Install class for the custom database tables.
Could not upload file System.Exception: Error unpacking extension on install package
Hi guys,
I use this package actions in my new package:
http://our.umbraco.org/wiki/reference/packaging/package-actions/community-made-package-actions
On load package I get this error message:
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)
I have isolated the problem, but I do not know why the error happens.
This is the related package action:
Without this line it works great:
But as soon as I add the line again I get the install error.
Does anyone know why this happens and how I can solve the problem?
Best,
Sören
Hi Sören
I don't know much about package actions but I'm thinking maybe you need to add ~/ in front of the path in the value attribute? (Long shont).
/Jan
Hi Jan,
thank you. But in log4net.config the path for file tag must be this format:
App_Data\Logs\mail2cms.log.txt
and not this format:
~/App_Data/Logs/mail2cms.log.txt
Best,
Sören
Hi Sören,
Must be something in the xml then, weird one maybe a character. I use this action in many packages without an issue. What you should do is use the package action tester http://our.umbraco.org/projects/developer-tools/package-action-tester and run in debug mode to see what is going on.
Hope this helps,
Richard
Hi Richard,
strange, the package tester say: AddXmlFragment - Installed...
Sören
And it did install?
No, there are no changes in the log4net.config-
Maybe copy the action in your code and then run the action in debug mode that should explain what happens.
Thank you Richard! I will make it this evening and give you feedback as soon as I found out something.
Hi Richard,
I have copy the action class AddXmlFragment.cs in a new clean visual studio project with umbraco 7.2.1 and have set a breakpoint to Execute - Function. But the function is not reached in this scenario. If I remove this line <filevalue="App_Data\Logs\mail2cms.log.txt"/> from my package actions I can install the package after loading and the function is reached and all works great.
But the error occurs if I click on "Load package" and due to the error I have not the possibility to install the package. Because that, the "Execute" function is not calling.
Can you or everyone check if you can execute the package action from my first post above and if the log4net.config is updated after this? I would like to know if the problem is only with me or if anyone else has the same problem with this specific code.
As I said, it works great without the row with the file tag...
Best,
Sören
I have tested now again.If I call the complete package action with Package Action Tester it works now. Maybe the log4net.config file was not loaded properly in editor again at yesterday.But this works!
Now I have changed this line
to
And with this I can load and install the package.
It seems that umbraco package installer has a problem on loading the package, if the tag <file> is included in AddXmlFragment package actions.
Can someone check this and confirm?
Best,
Sören
Hi Richard,
I have solved it with your package action tester!
I have removed the actions for log4net from package actions and included the most of your source files directly in my mail2cms solution. Then I insert this actions hardcoded and call the PackageActionService.ExecutePackageActions(executeModel) Function in my Install class for the custom database tables.
This works great :)
Thank you for the support!
#H5YR!
Best,
Sören
is working on a reply...