Saving a package with a CourierWebserviceRepositoryProvider gives error
Hi all,
Trying to develop quite a complex application to batch up some changes from one Umbraco installation and then apply them to another.
The pulling part works fine, however when the saving starts I always get the following error:
<Exception><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object reference not set to an instance of an object.</Message><StackTrace> at Umbraco.Courier.RepositoryProviders.CourierWebserviceRepositoryProvider.SaveResourceContents(ItemIdentifier itemId, Type itemType, Resource resource, String revisionAlias) in c:\Program Files (x86)\teamcity\buildAgent\work\2d3247b08adc3338\Umbraco.Courier.RepositoryProviders\WebserviceProvider\CourierWebserviceRepositoryProvider.cs:line 559
at Umbraco.Courier.Core.Packaging.RevisionPackaging.()
at Umbraco.Courier.Core.Packaging.RevisionPackaging.Package()
If I change the provider over to the local one then it works fine and since the issue is coming from inside Courier dll's I can't debug further without using a reflector, is this allowed with Courier?
Does anyone have any light to shed on this? Or has anyone successfully used the CourierWebserviceRepositoryProvider to save a revision?
The method that this is in is SaveResourceContents and it is called with a null value for the 2nd paramater.
The above line then tries to do a .ToString() on the value which causes the null reference exception.
As far as I can tell this happens everytime, I assume it's something to do with the manifest.xml file or the .couriercompare file as these are the only missing files from the revision folder.
I put a conditional in to pass an empty string if the 2nd parameter is null and so far it seems to be working fine.
Saving a package with a CourierWebserviceRepositoryProvider gives error
Hi all,
Trying to develop quite a complex application to batch up some changes from one Umbraco installation and then apply them to another.
The pulling part works fine, however when the saving starts I always get the following error:
<Exception><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object reference not set to an instance of an object.</Message><StackTrace> at Umbraco.Courier.RepositoryProviders.CourierWebserviceRepositoryProvider.SaveResourceContents(ItemIdentifier itemId, Type itemType, Resource resource, String revisionAlias) in c:\Program Files (x86)\teamcity\buildAgent\work\2d3247b08adc3338\Umbraco.Courier.RepositoryProviders\WebserviceProvider\CourierWebserviceRepositoryProvider.cs:line 559
at Umbraco.Courier.Core.Packaging.RevisionPackaging.()
at Umbraco.Courier.Core.Packaging.RevisionPackaging.Package()
If I change the provider over to the local one then it works fine and since the issue is coming from inside Courier dll's I can't debug further without using a reflector, is this allowed with Courier?
Does anyone have any light to shed on this? Or has anyone successfully used the CourierWebserviceRepositoryProvider to save a revision?
Cheers
Dave Hughes
Hi David
Can you shed some light on what you are trying to do with the revision? maybe a code snippet?
The Core is obfuscated and under a closed license, but the providers are all open source, and in our github repo:
https://github.com/umbraco/Courier/tree/master/Providers/Umbraco.Courier.RepositoryProviders
which is probably easier then using reflector :)
Ah brilliant, the issue lies here on line 559 of CourierWebServiceRespository.cs:
stringpath=repo.SaveResourceContents(itemId,itemType.ToString(),resource,revisionAlias,loginName,pass);
The method that this is in is SaveResourceContents and it is called with a null value for the 2nd paramater.
The above line then tries to do a .ToString() on the value which causes the null reference exception.
As far as I can tell this happens everytime, I assume it's something to do with the manifest.xml file or the .couriercompare file as these are the only missing files from the revision folder.
I put a conditional in to pass an empty string if the 2nd parameter is null and so far it seems to be working fine.
Cheers
just went through the code, you can safely do that, as the type alias is not used anywhere when the resource is saved to disk
Will put a fix in for 2.7 final
/per
Thats brilliant, thanks for all your help! :)
is working on a reply...