Stijn De Vos | Sitecore blog

Lead expert consultant @ delaware. Working with Sitecore, Azure, Kubernetes.

When trying to connect to Sitecore (hosted in AKS) from my Next.JS head (hosted externally), I got following error:

SSC API key is required. Pass with 'sc_apikey' query string or HTTP header.

The code that caused the issue was a textbook GraphQL request:

const graphQLClient = new GraphQLRequestClient(config.graphQLEndpoint, {
    apiKey: config.sitecoreApiKey,
});

Turns out nginx (that connects incoming AKS traffic to the actual Sitecore containers) does not allow underscores in header keys by default:

http://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers

This case (different use case though) is documented in SitecoreXP1020ProductionDeploymentWithKubernetes-en.pdf, see

4.6.3. When I request SSC, problems occur if there are underscores in header names

but since that document is not indexed by Google, finding it was not that easy.

Luckily somebody had a similar issue when running Sitecore on Amazon: https://github.com/Sitecore/jss/issues/1060.

The solution for k8s is straightforward. Simply add

enable-underscores-in-headers: "true"

to ingress-nginx\configuration.yaml (the configmap used by nginx).

Note that if you install this with kubectl -k ingress-nginx this requires nginx and Sitecore to run in the same namespace. If not, the config map is created in the Sitecore namespace, but won’t be picked up by nginx.

Sitecore Identity (SI), introduced in Sitecore 9.1, is the single sign-on mechanism for any Sitecore instance (XM, XP, XC, …) that requires authentication.

As it was provided in a web deploy package (WDP), making small config changes like integrating with Azure AD was straightforward. With Sitecore moving to containers, and SI thus being provided as container image, making these same config changes becomes more complex… unless you’re willing to throw some Kubernetes features at it.

Read more...

Recently, I was refactoring my Azure DevOps CI/CD scripts that setup and deploy Sitecore 10.1 on a newly created AKS. Deployment went smooth, until I tried to browse to the deployed environments. Nginx, configured with sitecore-ingress provided by Sitecore, returned a 404 Not Found. What gives?

Read more...

UPDATE: apparently this issues keeps happening every restart :(. It’s being tracked on https://forums.docker.com/t/error-message-when-trying-to-switch-to-windows-container/113809/15. Hopefully a permanent fix is released soon.

Docker is a great tool, except when it’s not.

Yesterday I picked up on container development after some inactivity. Before I could start, quite some updates were pushed (in case you missed it: in a recent change, only paid plans are allowed to skip updates). Eventually everything worked as expected

Today, after a reboot, I faced following error:

Resetting to factory defaults did not help (it did help clean out my hard drive since resetting deletes all your downloaded images).

Reinstalling did help a bit: docker succeeded to start up in Linux mode. However, switching to Windows mode threw the same exception.

Since the exception is not very detailed, I had to dig a little deeper: good old Event Viewer to the rescue. Turns out something is wrong with the panic log (love the name).

After inspecting the file it turns out it’s marked as readonly:

Unchecking the checkbox and restarting docker solves the issue.

Tags: #docker

As you might have heard, Sitecore acquired four51.io, a company know for it’s product called OrderCloud, a next-generation, B2B-focused commerce platform based on MACH architecture. Sitecore rebranded this into Sitecore OrderCloud.

Since it’s a SaaS tool, you can setup a free account within minutes: simply register on https://ordercloud.io to get your sandbox environment (no credit card needed :)). The getting started guide gives you a good understanding of the basic concepts.

Here are my first impressions on it after browsing through the playground environment and the API reference.

Read more...

I was contacted by a client to help them roll out Sitecore Kubernetes deployment (hooray for clients willing to invest in technology updates). Of course I came in prepared: I tried out Installation Guide for Production Environment with Kubernetes (on Azure AKS with my own subscription), and had a shiny new Sitecore 10.x up and running on https://globalhost.cd in no time.

When repeating the setup on the client’s subscription, deployment went well but we failed to log in into Sitecore:

Read more...

Enter your email to subscribe to updates.