Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » parsing "?ID=1" - Quantifier {x,y} following nothing

parsing "?ID=1" - Quantifier {x,y} following nothing

Peter Leleulya
Reply

Hi guys,

I'm updating an app due to the cart loss experience (https://doc.dynamicweb.com/forum/development/development/critical-issue-with-cart-cookie) using NUGET from 9.4.18 to latest stable 9.5.6.

When I start the app after updating just the admin I get an error: parsing "?ID=1" - Quantifier {x,y} following nothing. (see attachement)
This happens when I go to the root of my site, in my case http://myapplication.localhost/
I think it happens when Dynamicweb is redirecting to the first page of the website.

When I navigate manually to http://myapplication.localhost/?id=1 there is no problem, the webpage shows

When I navigate manually to http://myapplication.localhost/homepage (the actual page url according to Dynamicweb CMS), which due to settings redirects to http://myapplication.localhost/ the

stacktrace error shows again.

I reran the update scripts and read all the release notest from 9.4.18 to 9.5.6, but can't find an explanation or fix for this issue ...

The only way I can work around this is by adding a redirect in my web.config, but that can't be right ... (see attachement)

I tried updating all other nuget packages, but that didn't help unfortunately ...

Is there a setting I missed?
Any idea what I can do? I don't like adding that redirect ...

 

 

 

 

Server Error in '/' Application.


parsing "?ID=1" - Quantifier {x,y} following nothing.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: parsing "?ID=1" - Quantifier {x,y} following nothing.

Source Error:
 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[ArgumentException: parsing "?ID=1" - Quantifier {x,y} following nothing.]
   System.Text.RegularExpressions.RegexParser.ScanRegex() +1976
   System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op) +164
   System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout, Boolean useCache) +362
   System.Text.RegularExpressions.Regex.Replace(String input, String pattern, String replacement, RegexOptions options) +93
   Dynamicweb.Frontend.SearchEngineFriendlyURLs.ResolveQueryString(String fullQueryString, Int32 pageid, String alternatekey) +1468
   Dynamicweb.Frontend.PageView.get_SearchFriendlyUrl() +537
   Dynamicweb.Frontend.PageView.SetMetaData() +1117
   Dynamicweb.Frontend.PageView.Load() +2334
   Dynamicweb.Frontend.DynamicwebHttpHandler.ProcessRequest(HttpContext context) +200
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +866
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3160.0              

UpdateTo956_CustomizedUrlSettings.PNG UpdateTo956_Error.PNG UpdateTo956_Workaround.PNG

Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Ouch! That seems to be a nasty bug that was introduced in 9.5.6 (Dynamicweb 9.5.19 nuget package)

TFS #58542 - System.ArgumentException occurs when parsing friendly URL for home page

Workaround:

Either disable "Canonical link in meta" in Settings > Web and HTTP > Customized URLs OR enter something in the "Canonical" field on the home page, e.g. "/"
.. or downgrade to an earlier version.

Sorry for the inconvenience.

Best regards,
Morten

 
Peter Leleulya
Reply

Thanks for the feedback Morten

 
Peter Leleulya
Reply

Hmm, 9.5.5 also contains the bug.
I implemented the canonical, which seems to do the trick ...

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

When using Nuget you need to ensure that the Dynamicweb package is downgraded to version 9.5.18 or lower.

/Morten

 
Claus Kølbæk
Claus Kølbæk
Reply

Hey Morten.

Just hit this problem on a solution aswell, but it already had the canonical settings disabled and setting a / in the frontpage options did nothing aswell.

Sadly downgrading is also not an option, as it was upgraded to fix another bug :)

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Claus,

Is this using the 9.5.6 release?

Is the stack trace exactly the same?

Is the issue affecting the home page or other pages?

If you are using packages then please tell me the version number of the Dynamicweb package / assembly.

/Morten

 
Claus Kølbæk
Claus Kølbæk
Reply

Hey Morten

There is a support case on the subject that you can check out if you want. (CAS-07680-M9Y0K8) :) But to answer the questions

1. Yes

2. Not exactly, but pretty close. (see below)

3. Only home page.

4. It is using the normal old updating, and running on a dw cloud.

ST:

Exception in template: System.ArgumentException: parsing "?ID=13" - Quantifier {x,y} following nothing.
at System.Text.RegularExpressions.RegexParser.ScanRegex()
at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, TimeSpan matchTimeout, Boolean useCache)
at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, String replacement, RegexOptions options)
at Dynamicweb.Frontend.SearchEngineFriendlyURLs.ResolveQueryString(String fullQueryString, Int32 pageid, String alternatekey)
at Dynamicweb.Frontend.PageView.get_SearchFriendlyUrl()
at CompiledRazorTemplates.Dynamic.cbcabcbbf.Execute()
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
at RazorEngine.Razor.Parse[T](String razorTemplate, T model, DynamicViewBag viewBag, String cacheName)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Claus,

Thanks for the additional info. We will look into that.

I'm curious why you are using SearchFriendlyURL directly in your template?

URLs are automatically parsed and replaced by Dynamicweb. So normally you should just add links in the default format, like "Default.aspx?ID=123" and Dynamicweb will make sure to replace those with friendly URLs.

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Claus

I've been looking into this with Morten and we have found the error.

In your template you have this:
<meta property="og:url" content="@(openGraphDomain)@Pageview.SearchFriendlyUrl" />

I have commented the call to Pageview.SearchFriendlyUrl out since that is the root of the issue. It only happens if the URL is http://hostname/ - ending in the / after the hostname.

We just made a fix for TFS #58542 that we will release ASAP. But until the site works with the outcommented line of code.

Sorry about the onconvenience!

BR Nicolai

Votes for this answer: 1
 
Claus Kølbæk
Claus Kølbæk
Reply

The page also worked when using "show page" from backend and such, so it was not a big deal as it is not yet live, but I was wondering why the only thing related to SearchFriendlyUrl was outcommented and still causing an error, just before I went home - so now I know why wink

To answer why it is there , I think the idea was the awoid writing something like "/Default.aspx?ID="+Pageview.ID - and since there is not .link or similar it just made sense to use the .SearchFriendlyUrl as it provided everything needed, so it was either that it was simply more pleasing to look at or maybe the parser don't parse an url in the meta property? I really can't remember the exact reason to be honest smiley

 
Nicolai Pedersen
Reply

Hi Claus

Links in the meta tags are not parsed. So using this property makes sense in that context.

BR Nicolai

 
Simon Nordahl
Simon Nordahl
Reply

Hi,

Any ETA on when the bug in 9.5.6 will be fixed? Just tried to downgrade to 9.5.5, but the download page currently throws a 404.

 

Regards Simon Nordahl

 
Nicolai Pedersen
Reply

Hi Simon

9.5.7 is due after new year... The fix is to be found in Dynamicweb package version 9.5.22 which is released.

Sorry about the inconvenience!

BR Nicolai

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Simon

The 9.5.7 hotfix version is now released

You are able to find this build in the download section:

http://doc.dynamicweb.com/releases-and-downloads/releases

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1
 
Simon Nordahl
Simon Nordahl
Reply

Thanks it have been downloaded and seems to be working.

Regards

Simon Nordahl

 

You must be logged in to post in the forum