Tuesday, April 30, 2024

Sitecore Search - Crawler error and fix

During the crawler setup, I got below error 



Fix, some pages missing OG details, make sure your meta data is placed properly on all pages


    • Missing Fields: type
    • Required Fields: type, id
Some pages are showing 404, so published those pages

If you check the attributes, these two are by default mandatory field in the schema



to fix this issue, provide the fix type value in Search or add the attribute selector to get the value from the pages.

Tuesday, April 16, 2024

Troubleshooting Sitecore XM Cloud: Deployment Process Halted with Status Code 409 - Project and Environment Already in Deployment.

Lately, during the construction and deployment of the UAT environment, all builds were stuck in the queue and failed to respond. Despite numerous attempts to delete the builds, the issue persisted.



After posting about the problem in the Slack channel, we were unable to find a definitive solution. Consequently, we raised a Sitecore ticket, seeking assistance with the issue.


Slack Posted Question - I'm currently encountering an issue with deploying a build on the UAT environment. Despite waiting for several hours, the build remains stuck in the queue.


After canceling the build and attempting to restart the environment, it' showing an message  that the build is still running and it's preventing the restart.

Now, every build is getting queued up. Do we have any options available to resolve this issue? the same branch was successfully deployed to a different environment (Dev) without any issues.

I would greatly appreciate it if anyone who has experienced a similar problem could share their suggestions.

Console error was 

{

    "title": "Not Found",

    "status": 404,

    "detail": "Deployment entity not existing for deploymentId XXXXXXXXXX",

    "traceId": "XXXXXXXXXXXXXXXXXX"

}


There was an issue with our service connection, due to which environment was wrongfully marked as having a running deployment, got fix now.

Slack Reference -  Slack Conversation Link


Wednesday, February 7, 2024

Sitecore XM Cloud - Fixing URL Redirections in Next.js on Vercel Using vercel.json

When URLs don't redirect correctly, it can be frustrating. Recently, we faced this challenge in our Next.js app on Vercel. Let's walk through how we tackled it.

Our URLs containing spaces or special characters weren't redirecting properly on Vercel. This glitch disrupted our users' flow and needed fixing ASAP.

Exploring Solutions:

At first, we tried a JavaScript-based approach within our app code. It worked fine locally but didn't cut it on Vercel.

Leveraging vercel.json:

Next, we discovered Vercel's powerful vercel.json file. With it, we could define redirect rules to map old URLs to new ones. Simple yet effective!

Crafting the Solution:

We created a vercel.json file with rewrite rules. These rules told Vercel how to handle URLs with spaces or special characters, ensuring they redirected correctly.


Sample vercel.json Code:


{
    "rewrites": [
      {        
        "source": "/(.*)%20(.*)",
        "destination": "/$1-$2"
      },
      {        
        "source": "/(.*)\\s(.*)",
        "destination": "/$1-$2"
      }
    ]
  }
 

Deployment and Validation:

After updating the vercel.json file, we deployed our Next.js app on Vercel. Through testing, we confirmed that our URLs now redirected smoothly, no more hiccups!

Conclusion:

In our journey to fix URL redirection issues, we learned the power of vercel.json. By leveraging its capabilities, we resolved our problem and improved our users' experience. It's a reminder that sometimes, simple solutions are the best.

Tuesday, January 2, 2024

Unveiling Sitecore XM Cloud: Error Encountered Post-Publishing Visual Studio Project

 Recently, I got below error while publishing the VS project 



Microsoft (R) Visual C# Compiler version 4.8.3761.0

for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.



This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version.


Fix - I have to delete the VS publishing profile and that fixed the issue.