SlideShare a Scribd company logo
1 of 53
Download to read offline
EUROPE'S LEADING AEM DEVELOPER CONFERENCE
25th – 27th SEPTEMBER 2023
The curious case of misrendered JSON
Jakub Wądołowski, diva-e (@jwadolowski)
Let’s talk failure
https://flic.kr/p/88bWKw
Project context
▪ e-commerce platform
▪ AEMaaCS as headless content API (JSON)*
▪ Sling Model Exporter
▪ Hyperlinked API (driven by content structure)
▪ Custom SPA Editor (WYSIWYG)
https://flic.kr/p/xJi1En
How it’s made?
https://flic.kr/p/r7Syak
JSON structure
https://flic.kr/p/ANM3jp
June 2021
“Approx. 29% of AEM requests end
with misrendered JSON and 200 status
code”
https://flic.kr/p/9bUbH3
Missing JSON data reasons
▪ Content issues
▪ Deployment / caching issue
▪ AEM downtime / maintenance
https://flic.kr/p/bJoDYk
Troubleshooting phase
▪ Not reproducible on local AEM
▪ Debug loggers / headers
▪ Page (re)activation solves the problem
▪ Cache bypassing tricks
▪ Ongoing monitoring
https://flic.kr/p/c5xUxS
“If you torture the data long enough, it
will confess to anything”
Ronald H. Coase
Analysis results
▪ Incomplete AEMaaCS logs (Loki 2.3 issue)
▪ No relevant log entries
▪ New endpoints with invalid JSON
▪ Bypassed cache == issue is gone*
▪ Warmup service goes first*
https://flic.kr/p/dgfRgD
AEMaaCS startup and warmup service
▪ AEMaaCS /systemready probe
▪ Warmup service
▪ goal: pre-populate dispatcher cache
▪ requests the most popular URLs (last 24h)
▪ Host header is taken into account
https://flic.kr/p/xGJnBw
Unreliable API == angry developers
https://flic.kr/p/czHNpq
Disable caching!
https://flic.kr/p/oaMedF
New hope
▪ SKYOPS-16686 (~mid July 2021)
▪ dead end
▪ SKYOPS-17857 (~mid Aug 2021)
▪ delivered early Sep 2021
https://flic.kr/p/8JhwbU
Over the finish line
▪ AEMaaCS 2021.8.5755 includes the fix
▪ Dispatcher caching got re-enabled
▪ No JSON issues for 2 weeks - let’s celebrate!
https://flic.kr/p/5bdFXt
Whack-a-mole time begins!
https://flic.kr/p/7r9TAS
Asset data vanished
▪ “skyline-service-warmup” goes first again
▪ Affected 1 out of 2 publish instances
▪ Duration: ~6 hours
▪ (Re)activation fixes everything
https://flic.kr/p/aH4q2
Race conditions
▪ Publish isn’t fully ready when warmup starts
▪ Dynamic Media fault?
▪ Does “Accept-Encoding” matter?
▪ How /systemready works?
https://flic.kr/p/xL4C1D
Why?
https://flic.kr/p/8vT9yB
The naive loop
• (Re)start local AEM instance
• AEM state snapshots
• /systemready
• OSGi bundles/components/services
• misbehaving JSON
https://flic.kr/p/deCibc
AEM startup stages
▪ #1
▪ /systemready 503
▪ JSON 404
▪ #2
▪ /systemready 503
▪ JSON 200 + invalid data
▪ #3
▪ /systemready 503
▪ JSON 200 + correct data
▪ #4
▪ /systemready 200
▪ JSON 200 + correct data
https://flic.kr/p/cmoAhY
Healthchecks
▪ Let’s create a custom one!
▪ Extend the built-in healthcheck config
https://flic.kr/p/2me55Vo
org.apache.felix.hc.generalchecks.DsComponentsCheck~myproject-systemready.cfg.json
Warning!
▪ Nonexistent component on the list
▪ Mind refactored / renamed components
https://flic.kr/p/5nmVJy
December 2021 / January 2022
▪ Component list fine-tuning
▪ It’s finally over!
https://flic.kr/p/qPu4DZ
May/June 2022
▪ Guess who’s back?
https://flic.kr/p/9eMnKj
Development gap
▪ New code == new healthcheck entries
https://flic.kr/p/abg7JF
September 2022
▪ Unexpected JSON cutoff
https://flic.kr/p/2kZcf4k
Next steps
▪ SLING-11569 (released in Sling 2.11.0)
▪ AEMaaCS 2022.12.10488 (Sling 2.12.2)
https://flic.kr/p/LA2Ta
Remember asset issues?
▪ Invalid asset links (DAM instead of DM)
https://flic.kr/p/2jxjahF
Asset link hurdles
▪ DM is not enabled everywhere
▪ Enabled DM implies blocked DAM access (404)
▪ /conf/global/settings/dms7enabled - bad idea!
▪ Per asset DM detection (dam:scene7File)
▪ Dedicated option for DAM fallback
https://flic.kr/p/CyXpjV
The end!?
▪ Kind of…
https://flic.kr/p/CyXpjV
June 2023
▪ JSON cutoff strikes back
▪ This time in Single Page Editor (AEM Author)
▪ Beware of AEMaaCS auto-upgrades
https://flic.kr/p/dypRQZ
Thank you!

More Related Content

Similar to The curious case of misrendered JSON

Top-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance PatternsStoyan Stefanov
 
The Web Becomes Graceful
The Web Becomes GracefulThe Web Becomes Graceful
The Web Becomes Gracefulcolorhook
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youPatrick Meenan
 
Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Docker, Inc.
 
Top-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTier1 app
 
Lightning時代のレポート ダッシュボード & Flow 最前線
Lightning時代のレポート ダッシュボード & Flow 最前線Lightning時代のレポート ダッシュボード & Flow 最前線
Lightning時代のレポート ダッシュボード & Flow 最前線Salesforce Developers Japan
 
Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices Daniel Berman
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevChau Thanh
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdevThanh Chau
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELKDaniel Berman
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)Stoyan Zhekov
 
EclipseCon France 2018 report
EclipseCon France 2018 reportEclipseCon France 2018 report
EclipseCon France 2018 reportAkira Tanaka
 
Top-5-Performance-JaxLondon-2023.pptx
Top-5-Performance-JaxLondon-2023.pptxTop-5-Performance-JaxLondon-2023.pptx
Top-5-Performance-JaxLondon-2023.pptxTier1 app
 

Similar to The curious case of misrendered JSON (20)

Top-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
 
JavaScript Performance Patterns
JavaScript Performance PatternsJavaScript Performance Patterns
JavaScript Performance Patterns
 
Cocoon OSGi CocoonGT2007
Cocoon OSGi CocoonGT2007Cocoon OSGi CocoonGT2007
Cocoon OSGi CocoonGT2007
 
The Web Becomes Graceful
The Web Becomes GracefulThe Web Becomes Graceful
The Web Becomes Graceful
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane Monitoring Containers at New Relic by Sean Kane
Monitoring Containers at New Relic by Sean Kane
 
Top-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptxTop-5-production-devconMunich-2023-v2.pptx
Top-5-production-devconMunich-2023-v2.pptx
 
Html 5 boot camp
Html 5 boot campHtml 5 boot camp
Html 5 boot camp
 
Front-end Wonderland
Front-end WonderlandFront-end Wonderland
Front-end Wonderland
 
Lightning時代のレポート ダッシュボード & Flow 最前線
Lightning時代のレポート ダッシュボード & Flow 最前線Lightning時代のレポート ダッシュボード & Flow 最前線
Lightning時代のレポート ダッシュボード & Flow 最前線
 
Rails 生態圈一覽
Rails 生態圈一覽Rails 生態圈一覽
Rails 生態圈一覽
 
Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices Machine Learning and Logging for Monitoring Microservices
Machine Learning and Logging for Monitoring Microservices
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Cache hcm-topdev
Cache hcm-topdevCache hcm-topdev
Cache hcm-topdev
 
Monitoring Docker with ELK
Monitoring Docker with ELKMonitoring Docker with ELK
Monitoring Docker with ELK
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
 
EclipseCon France 2018 report
EclipseCon France 2018 reportEclipseCon France 2018 report
EclipseCon France 2018 report
 
Selenium cloud
Selenium cloudSelenium cloud
Selenium cloud
 
Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)Introduction to the Archivematica API (September 2018)
Introduction to the Archivematica API (September 2018)
 
Top-5-Performance-JaxLondon-2023.pptx
Top-5-Performance-JaxLondon-2023.pptxTop-5-Performance-JaxLondon-2023.pptx
Top-5-Performance-JaxLondon-2023.pptx
 

More from Jakub Wadolowski

Automated CI with AEM Cloud service
Automated CI with AEM Cloud serviceAutomated CI with AEM Cloud service
Automated CI with AEM Cloud serviceJakub Wadolowski
 
Image optimization at the edge
Image optimization at the edgeImage optimization at the edge
Image optimization at the edgeJakub Wadolowski
 
Taming content delivery at scale
Taming content delivery at scaleTaming content delivery at scale
Taming content delivery at scaleJakub Wadolowski
 
Into the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformationInto the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformationJakub Wadolowski
 
How to seamlessly incorporate CDN into your application stack
How to seamlessly incorporate CDN into your application stackHow to seamlessly incorporate CDN into your application stack
How to seamlessly incorporate CDN into your application stackJakub Wadolowski
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyJakub Wadolowski
 
When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)Jakub Wadolowski
 
When dispatcher caching is not enough...
When dispatcher caching is not enough...When dispatcher caching is not enough...
When dispatcher caching is not enough...Jakub Wadolowski
 

More from Jakub Wadolowski (12)

Automated CI with AEM Cloud service
Automated CI with AEM Cloud serviceAutomated CI with AEM Cloud service
Automated CI with AEM Cloud service
 
The shift to the edge
The shift to the edgeThe shift to the edge
The shift to the edge
 
Image optimization at the edge
Image optimization at the edgeImage optimization at the edge
Image optimization at the edge
 
The shift to the edge
The shift to the edgeThe shift to the edge
The shift to the edge
 
Taming content delivery at scale
Taming content delivery at scaleTaming content delivery at scale
Taming content delivery at scale
 
Into the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformationInto the nooks and crannies of Boden’s digital transformation
Into the nooks and crannies of Boden’s digital transformation
 
How to seamlessly incorporate CDN into your application stack
How to seamlessly incorporate CDN into your application stackHow to seamlessly incorporate CDN into your application stack
How to seamlessly incorporate CDN into your application stack
 
Taming AEM deployments
Taming AEM deploymentsTaming AEM deployments
Taming AEM deployments
 
(Re)discover your AEM
(Re)discover your AEM(Re)discover your AEM
(Re)discover your AEM
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journey
 
When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)
 
When dispatcher caching is not enough...
When dispatcher caching is not enough...When dispatcher caching is not enough...
When dispatcher caching is not enough...
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

The curious case of misrendered JSON