vipickering / mastr-cntrl

A Micropub Microservice
MIT License
26 stars 2 forks source link

Swarm Logging #54

Closed vipickering closed 5 years ago

vipickering commented 5 years ago

I am spotting intermittent 503 errors on Swarm, related to the published node.

{..."err":{"message":"Cannot read property 'published' of undefined","name":"TypeError","stack":"TypeError: Cannot read property 'published' of undefined\n at Object.checkIn (/app/app/functions/formatters/swarm.js:8:51)\n at authAction (/app/app/routes/post/micropub.js:73:37)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:118:7)"},"msg":"Cannot read property 'published' of undefined","time":"2018-12-29T13:00:49.008Z","v":0}

I've added extra logging.

Leaving this open until I track the conditions to replicate and fix.

vipickering commented 5 years ago

Despite the error being thrown. I can see the published date is created correctly in the frontmatter.

vipickering commented 5 years ago

Worked it out.

Swarm sent a POST to the micropub route, to update the content to the same content (I've no idea why). I do not support the update request yet, so it timed out and failed harmlessly.

It couldn't find the published date, because on an update it just sends a time instead (like so).

"time":"2018-12-29T13:00:49.007Z"

The published node failed because it was the first JSON object it ran in to that wasn't supplied.