Sitecore.Ship icon indicating copy to clipboard operation
Sitecore.Ship copied to clipboard

Using Sitecore.Ship with version 8.1 of sitecore, issue with /services url

Open mmussitsch opened this issue 9 years ago • 11 comments

I had to download the source and build my own sitecore ship because of using sitecore 8.1. Everything was working fine until our content editors renamed an area of our site to be "services". So now they need the /services url to refer to their content area. But as you know sitecore ship uses the /services url for fileupload, publishing etc.
They went ahead and removed the entry from the ship.config file without my knowing. So two things

  1. I reverted back their change but it seems the url is still not found or working. When I try to run it via the cmd line, it says exactly that. Since they only changed a config file, I'm surprised putting /services back didn't just fix it.
  2. Is there a way to adjust the url to instead be "scshipservices" so that we can use "services" for their use? If so, can you provide instructions? We're fairly new to .NET. I hope it's okay to post this kind of issue here.

Thanks, Melissa M

mmussitsch avatar Dec 07 '15 15:12 mmussitsch

No one has responded yet -- but I need to take a step back. I did build my own and get Sitecore.Ship via the code to work on 8.0. Will it work on 8.1?

mmussitsch avatar Dec 08 '15 16:12 mmussitsch

The only way is via the code. /services is not configurable in Ship but I know Kevin was going to extract it out. Not sure if it got backlogged with the new Web API / SSC plans. If you ask me - it's ok to run your own custom version of it that fits your needs. Ship is infrastructure and it's hard to have one size fits all. I am using a fork too - the PR with token authentication wasn't merged (yet) and I need that on the instances with Ship exposed out.

Sent from my iPhone

On Dec 8, 2015, at 11:29 AM, mmussitsch [email protected] wrote:

No one has responded yet -- but I need to take a step back. I did build my own and get Sitecore.Ship via the code to work on 8.0. Will it work on 8.1?

— Reply to this email directly or view it on GitHub.

pveller avatar Dec 08 '15 17:12 pveller

Apologies guys, @pveller was spot on I have been swamped. Must try harder and will get those forked changesets looked at asap.

kevinobee avatar Dec 10 '15 18:12 kevinobee

Hi All.

Just a note to say we had a similar issue. Last time I checked (this Tuesday) we were playing with more specific, multiple, nancy httphandler paths to fix it but that was just one of my crazy on the spot ideas before quite literally running for the train. TBH I have to check what fixed it for us in the end but when I'm in the office next week I'll ping the result here. Might help someone!

David

peelybird avatar Jan 14 '16 19:01 peelybird

Ok so as it turns out, that was the answer. We replaced: <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="/services/*" /> in the <system.webserver><handlers> section with a specific entry for each required method: <add name="NancyPublish" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="/services/publish/*" /> <add name="NancyPackage" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="/services/package/*" />

I hope that's helpful for some.

David

peelybird avatar Jan 14 '16 20:01 peelybird

I am having a similar issue with Sitecore 8.1 (latest update) and Ship v0.4. When I add the handler under <system.webserver> i get the following exception on GET http://sc81/services/about

[FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)] System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +106 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +62 System.Type.GetType(String typeName) +42 Nancy.Hosting.Aspnet.NancyHttpRequestHandler.GetConfigurationBootstrapper() +112 Nancy.Hosting.Aspnet.NancyHttpRequestHandler.GetBootstrapper() +29 Nancy.Hosting.Aspnet.NancyHttpRequestHandler..cctor() +21

[TypeInitializationException: The type initializer for 'Nancy.Hosting.Aspnet.NancyHttpRequestHandler' threw an exception.] Nancy.Hosting.Aspnet.NancyHttpRequestHandler..ctor() +0

When I add the same in <httpHandlers> section under <system.web> it keeps getting back with 404 error.

Any pointers will be really helpful.

Thanks Mohit

mohit511 avatar Apr 19 '16 14:04 mohit511

@mohit511, did you try using the classic ASP.NET endpoint?

pveller avatar Apr 19 '16 14:04 pveller

Hi @pveller, yes i tried. added handlers <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="/services/*" resourceType="Unspecified" /> under <system.webserver><handlers> - keeps throwing the exception

mohit511 avatar Apr 19 '16 16:04 mohit511

I actually meant:

<add verb="*" 
     name="Sitecore.Ship"  
     type="Sitecore.Ship.AspNet.SitecoreShipHttpHandler, Sitecore.Ship.AspNet"
     path="/services/*" />

pveller avatar Apr 19 '16 19:04 pveller

Thank you @pveller. This works.

mohit511 avatar Apr 20 '16 03:04 mohit511

Sorry guys, I missed this email trail as I have been away travelling.

Thanks @pavel for responding :)

-----Original Message----- From: "mohit511" [email protected] Sent: ‎20/‎04/‎2016 10:20 To: "kevinobee/Sitecore.Ship" [email protected] Cc: "Kevin Obee" [email protected]; "Comment" [email protected] Subject: Re: [kevinobee/Sitecore.Ship] Using Sitecore.Ship with version 8.1 ofsitecore, issue with /services url (#52)

Thank you @pveller. This works. — You are receiving this because you commented. Reply to this email directly or view it on GitHub

kevinobee avatar Apr 20 '16 05:04 kevinobee