Validation error on post page

#1

I’m running Ghost 2.18.1. And when I visit a blog post page I’m seeing this error occur (heroku logs):

2019-03-18T12:54:05.272824+00:00 heroku[router]: at=info method=GET path= "/assets/images/favicon-32x32.png?v=c0aa2f6b26" host=matrix.ai request_id=6c4e3da2-67a9-441d-826c-8a37dc63d41a fwd="124.19.3.250,162.158.7.32" dyno=web.1 connect=1ms service=9ms status=200 bytes=1691 protocol=http
2019-03-18T12:54:21.599709+00:00 heroku[router]: at=info method=GET path="/blog/service-abstraction-and-communication-flows/" host=matrix.ai request_id=315279e1-0be9-49fe-90fc-13d23a3bd121 fwd="124.19.3.250,162.158.6.49" dyno=web.1 connect=0ms service=57ms status=200 bytes=4258 protocol=http
2019-03-18T12:54:21.596453+00:00 app[web.1]: [2019-03-18 12:54:21] ERROR
2019-03-18T12:54:21.596465+00:00 app[web.1]: 
2019-03-18T12:54:21.596467+00:00 app[web.1]: Validation (matches) failed for page
2019-03-18T12:54:21.596470+00:00 app[web.1]: 
2019-03-18T12:54:21.596471+00:00 app[web.1]: Error ID:
2019-03-18T12:54:21.596473+00:00 app[web.1]: f32a9fa0-497c-11e9-af76-8bc24190f1e2
2019-03-18T12:54:21.596475+00:00 app[web.1]: 
2019-03-18T12:54:21.596476+00:00 app[web.1]: ----------------------------------------
2019-03-18T12:54:21.596478+00:00 app[web.1]: 
2019-03-18T12:54:21.596480+00:00 app[web.1]: ValidationError: Validation (matches) failed for page
2019-03-18T12:54:21.596482+00:00 app[web.1]: at new ValidationError (/app/node_modules/ghost-ignition/lib/errors/index.js:121:23)
2019-03-18T12:54:21.596483+00:00 app[web.1]: at each (/app/node_modules/ghost/core/server/data/validation/index.js:348:35)
2019-03-18T12:54:21.596485+00:00 app[web.1]: at /app/node_modules/ghost/node_modules/lodash/lodash.js:4911:15
2019-03-18T12:54:21.596487+00:00 app[web.1]: at baseForOwn (/app/node_modules/ghost/node_modules/lodash/lodash.js:2996:24)
2019-03-18T12:54:21.596489+00:00 app[web.1]: at /app/node_modules/ghost/node_modules/lodash/lodash.js:4880:18
2019-03-18T12:54:21.596490+00:00 app[web.1]: at Function.forEach (/app/node_modules/ghost/node_modules/lodash/lodash.js:9344:14)
2019-03-18T12:54:21.596491+00:00 app[web.1]: at Object.validate (/app/node_modules/ghost/core/server/data/validation/index.js:320:7)
2019-03-18T12:54:21.596493+00:00 app[web.1]: at _.each (/app/node_modules/ghost/core/server/api/shared/validators/input/all.js:46:47)
2019-03-18T12:54:21.596495+00:00 app[web.1]: at /app/node_modules/ghost/node_modules/lodash/lodash.js:4911:15
2019-03-18T12:54:21.596497+00:00 app[web.1]: at baseForOwn (/app/node_modules/ghost/node_modules/lodash/lodash.js:2996:24)
2019-03-18T12:54:21.596498+00:00 app[web.1]: at /app/node_modules/ghost/node_modules/lodash/lodash.js:4880:18
2019-03-18T12:54:21.596500+00:00 app[web.1]: at Function.forEach (/app/node_modules/ghost/node_modules/lodash/lodash.js:9344:14)
2019-03-18T12:54:21.596502+00:00 app[web.1]: at validate (/app/node_modules/ghost/core/server/api/shared/validators/input/all.js:41:7)
2019-03-18T12:54:21.596503+00:00 app[web.1]: at Object.all (/app/node_modules/ghost/core/server/api/shared/validators/input/all.js:90:32)
2019-03-18T12:54:21.596505+00:00 app[web.1]: at allShared (/app/node_modules/ghost/core/server/api/shared/validators/handle.js:29:37)
2019-03-18T12:54:21.596506+00:00 app[web.1]: at /app/node_modules/ghost/core/server/lib/promise/sequence.js:10:31
2019-03-18T12:54:21.596508+00:00 app[web.1]: at tryCatcher (/app/node_modules/ghost/node_modules/bluebird/js/release/util.js:16:23)
2019-03-18T12:54:21.596510+00:00 app[web.1]: at Object.gotValue (/app/node_modules/ghost/node_modules/bluebird/js/release/reduce.js:157:18)
2019-03-18T12:54:21.596511+00:00 app[web.1]: at Object.gotAccum (/app/node_modules/ghost/node_modules/bluebird/js/release/reduce.js:144:25)
2019-03-18T12:54:21.596513+00:00 app[web.1]: at Object.tryCatcher (/app/node_modules/ghost/node_modules/bluebird/js/release/util.js:16:23)
2019-03-18T12:54:21.596514+00:00 app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/ghost/node_modu
les/bluebird/js/release/promise.js:512:31)
2019-03-18T12:54:21.596516+00:00 app[web.1]: at Promise._settlePromise (/app/node_modules/ghost/node_modules/bluebird/js/release/promise.js:569:18)
2019-03-18T12:54:21.596517+00:00 app[web.1]: at Promise._settlePromiseCtx (/app/node_modules/ghost/node_modules/bluebird/js/release/promise.js:606:10)
2019-03-18T12:54:21.596519+00:00 app[web.1]: at _drainQueueStep (/app/node_modules/ghost/node_modules/bluebird/js/release/async.js:142:12)
2019-03-18T12:54:21.596521+00:00 app[web.1]: at _drainQueue (/app/node_modules/ghost/node_modules/bluebird/js/release/async.js:131:9)
2019-03-18T12:54:21.596522+00:00 app[web.1]: at Async._drainQueues (/app/node_modules/ghost/node_modules/bluebird/js/release/async.js:147:5)
2019-03-18T12:54:21.596524+00:00 app[web.1]: at Immediate.Async.drainQueues [as _onImmediate] (/app/node_modules/ghost/node_modules/bluebird/js/release/async.js:17:14)
2019-03-18T12:54:21.596526+00:00 app[web.1]: at runCallback (timers.js:705:18)
2019-03-18T12:54:21.596528+00:00 app[web.1]: at tryOnImmediate (timers.js:676:5)
2019-03-18T12:54:21.596530+00:00 app[web.1]: at processImmediate (timers.js:658:5)
2019-03-18T12:54:21.596531+00:00 app[web.1]: at process.topLevelDomainCallback (domain.js:120:23)

This error doesn’t occur when I run ghost locally, the blog post appears normally. Only when it is pushed onto heroku. I don’t see any documentation as to what this error means or why it can occur.

0 Likes

#2

Hey @CMCDragonkai :wave: The error indicates that ‘matches’ validator failed for page resource, which is most likely triggered in slug field validation. Could you please provide the request values that produce this error?

0 Likes

#3

Hi @gargol, can you elaborate what is a matches validator. And what exactly is a slug field validation.

I don’t know how to provide request values you’re asking for. Are you asking for the exact page at which this is happening? Well here’s the page where this is happening: https://matrix.ai/blog/service-abstraction-and-communication-flows/

If I check heroku logs it is always showing that validation error occurring over and over on each page load.

The handlebar template for the post.hbs is:

{{!< default}}

{{#post}}
  {{> post-meta}}
  {{!--  <div class="post-metadata-container" data-stellar-ratio="0.75">  --}}
  <div class="post-metadata-container">
    <div class="post-metadata-content">
    {{> title}}
    {{!--  {{> sidebar}}  --}}
    </div>
  </div>

  <div class="push-article">
    {{! Temporary indentation shift for Handlebars issue }}
    {{> content}}
  </div>

  <div class="container">
      <div class="author animated fadeIn clearfix">
          {{#primary_author}}
              <img src="{{img_url profile_image}}" alt="{{name}}" />
              <div class="info">
                  <a href="{{url}}" class="name">{{name}}</a>
                  <p class="bio">{{bio}}</p>
              </div>
          {{/primary_author}}
      </div>
  </div>
  {{> comments}}
{{/post}}
0 Likes

#4

This error occurs when the server receives an incorrect page option. For example, if you would do a call similar to this: GET http://ghost.local/ghost/api/v2/content/posts/?key=XXX&page=invalid_page or when you are using {{get}} helper inside of handlebars template similar error can be triggered with syntax like this:

{{#get "tags" limit="5" page="undefined"}}{{tags}}{{/get}}

On the template you provided, there’s no use of page parameter. Could you please check if it’s used in any of the partials and if the value passed is correct?

0 Likes

closed #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

0 Likes