question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google AMP cache error: unknown path prefix in url

See original GitHub issue

Description

According to Google Search Console, my website (thrivous.com) has around 170 valid AMP pages. They all load fine and validate when accessed directly by appending #development=1 to the AMP URL.

However, when I attempt to access them in the Google AMP Cache, I get the following error message: “unknown path prefix in url.” Then the page redirects to the non-cached AMP page.

I have verified, using the Google AMP Cache URL API, that I’m using the correct Google AMP Cache URLs. They exist. And the API reports no errors.

Here’s an example:

{ “ampUrls”: [ { “originalUrl”: “https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill”, “ampUrl”: “https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp”, “cdnAmpUrl”: “https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp” } ] }

I can load the originalUrl and ampUrl without problems. When I attempt to load the cdnAmpUrl, I get the “unknown path prefix in url” in the browser console. And then the page redirects to the ampUrl.

This used to work fine. And, in fact, after I ran the Google AMP Cache URL API, it worked fine again for one or two page loads. But then it returned to giving the error message and redirecting. And running the API again doesn’t seem to fix it again.

I have attempted to present this issue to the Google support community. No one has been able to identify a solution. One person suggested that I post the issue here. That thread contains additional information, including screenshots:

https://support.google.com/webmasters/thread/115641650/how-do-i-fix-the-google-amp-cache-error-unknown-path-prefix-in-url?hl=en

How can I fix this permanently, so that the Google AMP Cache works without redirecting?

Reproduction Steps

  1. Verify that sample AMP page is validating:

https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp#development=1

  1. Attempt to load sample AMP page in Google AMP cache:

https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp

  1. Review web browser console. And note the following:

(a) The page redirected from the Google AMP cache to the original page.

(b) There’s an error message: “Unknown path prefix in url https://thrivous-com.cdn.ampproject.org/

Relevant Logs

amp.js:159 Powered by AMP ⚡ HTML – Version 2107030008001 https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp#development=1
VM22:999 AMP validation successful.
VM22:999 Review our 'publishing checklist' to ensure successful AMP documentdistribution. See https://go.amp.dev/publishing-checklist
Navigated to https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp
Navigated to https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp
amp.js:159 Powered by AMP ⚡ HTML – Version 2107030008001 https://thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp
error-reporting.js:208 Unknown path prefix in url  https://thrivous-com.cdn.ampproject.org/ ​​​
uf @ error-reporting.js:208
(anonymous) @ error-reporting.js:127
fb @ base.js:88
g.assert @ log.js:392
K @ log.js:794
df @ url.js:522
(anonymous) @ url-replacements-impl.js:165
Promise.then (async)
(anonymous) @ url-replacements-impl.js:160
(anonymous) @ promise.js:82
qa @ promise.js:81
Nk @ expander.js:359
Lk @ expander.js:336
d @ expander.js:210
Kk @ expander.js:295
Ik.expand @ expander.js:107
g.expandStringAsync @ url-replacements-impl.js:833
(anonymous) @ variables.js:500
Promise.then (async)
Mc @ variables.js:499
(anonymous) @ variables.js:435
(anonymous) @ index.js:187
sa @ index.js:177
Hc.expandTemplate @ variables.js:409
Re @ requests.js:207
Oe.send @ requests.js:137
(anonymous) @ amp-analytics.js:699
Promise.then (async)
wf @ amp-analytics.js:669
l.Sc @ amp-analytics.js:636
l.nc @ events.js:1707
(anonymous) @ visibility-manager.js:519
l.fire @ observable.js:78
(anonymous) @ visibility-model.js:76
Promise.then (async)
Nd @ visibility-model.js:75
de @ visibility-manager.js:413
l.listenRoot @ visibility-manager.js:286
l.add @ events.js:1519
c @ analytics-group.js:97
ne.addTrigger @ analytics-group.js:110
vf @ amp-analytics.js:453
(anonymous) @ amp-analytics.js:415
Promise.then (async)
l.jd @ amp-analytics.js:388
Promise.then (async)
of @ amp-analytics.js:262
l.layoutCallback @ amp-analytics.js:166
(anonymous) @ custom-element.js:1625
(anonymous) @ promise.js:82
qa @ promise.js:81
Qi.b.layoutCallback @ custom-element.js:1625
(anonymous) @ resource.js:897
am @ vsync-impl.js:468
g.wh @ vsync-impl.js:425
requestAnimationFrame (async)
Zl @ vsync-impl.js:392
g.Aa @ vsync-impl.js:386
g.run @ vsync-impl.js:185
g.runPromise @ vsync-impl.js:200
rj @ mutator-impl.js:206
g.mutateElement @ mutator-impl.js:153
ba @ amp-auto-lightbox.js:277
Z @ amp-auto-lightbox.js:320
(anonymous) @ amp-auto-lightbox.js:499
Promise.then (async)
(anonymous) @ amp-auto-lightbox.js:494
f @ amp-auto-lightbox.js:492
g.registerExtension @ extensions-impl.js:174
(anonymous) @ runtime.js:186
Promise.then (async)
(anonymous) @ runtime.js:182
Fi @ chunk.js:203
Bi.kf @ chunk.js:422
(anonymous) @ chunk.js:478
Promise.then (async)
Ii @ chunk.js:477
Bi.Aa @ chunk.js:496
Bi.runForStartup @ chunk.js:381
Ci @ chunk.js:72
om @ runtime.js:296
b @ runtime.js:197
c.AMP.push @ runtime.js:229
(anonymous) @ amp-auto-lightbox-0.1.js:1
base.js:83 Uncaught Error: Unknown path prefix in url https://thrivous-com.cdn.ampproject.org/​​​
    at fb (base.js:83)
    at yb.g.assert (log.js:392)
    at K (log.js:794)
    at df (url.js:522)
    at url-replacements-impl.js:165
fb @ base.js:83
g.assert @ log.js:392
K @ log.js:794
df @ url.js:522
(anonymous) @ url-replacements-impl.js:165
setTimeout (async)
za @ index.js:73
(anonymous) @ expander.js:378
Promise.catch (async)
Nk @ expander.js:377
Lk @ expander.js:336
d @ expander.js:210
Kk @ expander.js:295
Ik.expand @ expander.js:107
g.expandStringAsync @ url-replacements-impl.js:833
(anonymous) @ variables.js:500
Promise.then (async)
Mc @ variables.js:499
(anonymous) @ variables.js:435
(anonymous) @ index.js:187
sa @ index.js:177
Hc.expandTemplate @ variables.js:409
Re @ requests.js:207
Oe.send @ requests.js:137
(anonymous) @ amp-analytics.js:699
Promise.then (async)
wf @ amp-analytics.js:669
l.Sc @ amp-analytics.js:636
l.nc @ events.js:1707
(anonymous) @ visibility-manager.js:519
l.fire @ observable.js:78
(anonymous) @ visibility-model.js:76
Promise.then (async)
Nd @ visibility-model.js:75
de @ visibility-manager.js:413
l.listenRoot @ visibility-manager.js:286
l.add @ events.js:1519
c @ analytics-group.js:97
ne.addTrigger @ analytics-group.js:110
vf @ amp-analytics.js:453
(anonymous) @ amp-analytics.js:415
Promise.then (async)
l.jd @ amp-analytics.js:388
Promise.then (async)
of @ amp-analytics.js:262
l.layoutCallback @ amp-analytics.js:166
(anonymous) @ custom-element.js:1625
(anonymous) @ promise.js:82
qa @ promise.js:81
Qi.b.layoutCallback @ custom-element.js:1625
(anonymous) @ resource.js:897
am @ vsync-impl.js:468
g.wh @ vsync-impl.js:425
requestAnimationFrame (async)
Zl @ vsync-impl.js:392
g.Aa @ vsync-impl.js:386
g.run @ vsync-impl.js:185
g.runPromise @ vsync-impl.js:200
rj @ mutator-impl.js:206
g.mutateElement @ mutator-impl.js:153
ba @ amp-auto-lightbox.js:277
Z @ amp-auto-lightbox.js:320
(anonymous) @ amp-auto-lightbox.js:499
Promise.then (async)
(anonymous) @ amp-auto-lightbox.js:494
f @ amp-auto-lightbox.js:492
g.registerExtension @ extensions-impl.js:174
(anonymous) @ runtime.js:186
Promise.then (async)
(anonymous) @ runtime.js:182
Fi @ chunk.js:203
Bi.kf @ chunk.js:422
(anonymous) @ chunk.js:478
Promise.then (async)
Ii @ chunk.js:477
Bi.Aa @ chunk.js:496
Bi.runForStartup @ chunk.js:381
Ci @ chunk.js:72
om @ runtime.js:296
b @ runtime.js:197
c.AMP.push @ runtime.js:229
(anonymous) @ amp-auto-lightbox-0.1.js:1

Browser(s) Affected

Chrome, Safari

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
LincolnCannoncommented, Aug 23, 2021

@LincolnCannon The change is live now. It looks like https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp is no longer redirecting, but please verify on your end and let me know if you continue to see issues.

It’s working! Thanks again, all, for your help – very much appreciated.

1reaction
twifkakcommented, Aug 23, 2021

@LincolnCannon The change is live now. It looks like https://thrivous-com.cdn.ampproject.org/c/s/thrivous.com/blogs/views/wheres-the-real-nzt-48-limitless-pill?view=amp is no longer redirecting, but please verify on your end and let me know if you continue to see issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the Google AMP Cache error: unknown path ...
When I attempt to load the cdnAmpUrl, I get the "unknown path prefix in url" in the browser console. And then the page...
Read more >
Core Errors | Google AMP Cache
Only media downloads requests can be sent to /download/* URL paths. Resend the request to the same path, but without the /download prefix....
Read more >
AMP Cache URL Format and Request Handling
The “path” of a URL on the AMP Cache is always comprised of one or more prefix directories, such as /c , followed...
Read more >
Fix list for IBM WebSphere Application Server V8.5
PH45080, Issue an error when certificate request file path contains spaces ... PH40676, Allow Websphere Application Server to return jar urls rather than ......
Read more >
All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found