René's URL Explorer Experiment


Title: Elasticsearch 8.x compatibility issue: persistence-elastic hook fails with TypeError on bulk indexing · Issue #3385 · secureCodeBox/secureCodeBox · GitHub

Open Graph Title: Elasticsearch 8.x compatibility issue: persistence-elastic hook fails with TypeError on bulk indexing · Issue #3385 · secureCodeBox/secureCodeBox

X Title: Elasticsearch 8.x compatibility issue: persistence-elastic hook fails with TypeError on bulk indexing · Issue #3385 · secureCodeBox/secureCodeBox

Description: Description The persistence-elastic hook (version 5.2.0) fails when attempting to persist scan findings to Elasticsearch 8.x due to an API response format incompatibility. The hook works correctly with Elasticsearch 7.x but crashes with ...

Open Graph Description: Description The persistence-elastic hook (version 5.2.0) fails when attempting to persist scan findings to Elasticsearch 8.x due to an API response format incompatibility. The hook works correctly ...

X Description: Description The persistence-elastic hook (version 5.2.0) fails when attempting to persist scan findings to Elasticsearch 8.x due to an API response format incompatibility. The hook works correctly ...

Opengraph URL: https://github.com/secureCodeBox/secureCodeBox/issues/3385

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Elasticsearch 8.x compatibility issue: persistence-elastic hook fails with TypeError on bulk indexing","articleBody":"## Description\n\nThe `persistence-elastic` hook (version 5.2.0) fails when attempting to persist scan findings to Elasticsearch 8.x due to an API response format incompatibility. The hook works correctly with Elasticsearch 7.x but crashes with a `TypeError` when using Elasticsearch 8.5.1 or later.\n\n \n\n## Error Message\n\nTypeError: Cannot read properties of undefined (reading 'errors') at handle (file:///home/app/hook-wrapper/hook/hook.js:110:22)\n\n \n\n \n\n## Impact\n\n \n\n- **Severity:** Medium\n\n- **Affected Users:** users running Elasticsearch 8.x with persistence-elastic hook\n\n- **Functionality:** Complete persistence failure - findings are not indexed in Elasticsearch\n\n- **Workaround:** Downgrade to Elasticsearch 7.17.x (not ideal for production)\n\n \n\n## Steps to Reproduce\n\n \n\n   ```bash\n\n   helm install elasticsearch elastic/elasticsearch \\\n\n     --version 8.5.1 \\\n\n     --set replicas=1 \\\n\n     --namespace default\n\n \n\nhelm install persistence-elastic \\\n\n  oci://[ghcr.io/securecodebox/helm/persistence-elastic](http://ghcr.io/securecodebox/helm/persistence-elastic) \\\n\n  --version 5.2.0 \\\n\n  --namespace default\n\n \n\nkubectl apply -f - \u003c\u003cEOF\n\napiVersion: \"[execution.securecodebox.io/v1](http://execution.securecodebox.io/v1)\"\n\nkind: Scan\n\nmetadata:\n\n  name: trivy-test\n\nspec:\n\n  scanType: \"trivy-image\"\n\n  parameters:\n\n    - \"nginx:latest\"\n\nEOF\n\n \n\nkubectl logs -l [app.kubernetes.io/name=persistence-elastic](http://app.kubernetes.io/name=persistence-elastic)\n\n \n\n \n\nExpected Behavior\n\nThe persistence hook should successfully index findings to Elasticsearch 8.x, just as it does with Elasticsearch 7.x.\n\n \n\nActual Behavior\n\nThe persistence hook crashes with TypeError: Cannot read properties of undefined (reading 'errors') when attempting to process the Elasticsearch bulk API response.\n\n \n\nRoot Cause Analysis\n\nThe issue is in the hook's handling of the Elasticsearch bulk API response. The response format changed between Elasticsearch 7.x and 8.x:\n\n \n\nElasticsearch 7.x response:\n\n{\n\n  body: {\n\n    errors: false,\n\n    items: [...]\n\n  }\n\n}\n\n \n\nElasticsearch 8.x response:\n\n{\n\n  errors: false,\n\n  items: [...]\n\n  // No .body wrapper\n\n}\n\n \n\nCurrent hook code (approximately line 110 in hook.js):\n\nconst { body: bulkResponse } = await client.bulk({ refresh: true, body });\n\n \n\nif (bulkResponse.errors) {  // ← TypeError here when bulkResponse is undefined\n\n  console.error(\"Bulk Request had errors:\");\n\n  console.log(bulkResponse);\n\n}\n\n \n\n \n\nWhen using Elasticsearch 8.x, the destructuring { body: bulkResponse } results in bulkResponse being undefined because the response doesn't have a .body property. This causes the TypeError when trying to access bulkResponse.errors.\n\n \n\nProposed Solution\n\nImplement a backwards-compatible fix that works with both Elasticsearch 7.x and 8.x:\n\n \n\n// Proposed fix for hook.js around line 110\n\nconst response = await client.bulk({ refresh: true, body });\n\n \n\n// Support both ES 7.x (response.body) and ES 8.x (response directly)\n\nconst bulkResponse = response.body || response;\n\n \n\nif (bulkResponse.errors) {\n\n  console.error(\"Bulk Request had errors:\");\n\n  console.log(bulkResponse);\n\n}\n\n \n\nThis change:\n\n \n\n✅ Works with Elasticsearch 7.x (uses response.body)\n\n✅ Works with Elasticsearch 8.x (uses response directly)\n\n✅ No breaking changes to existing functionality\n\n✅ Simple one-line fix\n\n✅ Follows the pattern used by Elasticsearch's official Node.js client migration guide\n\nEnvironment\n\nSecureCodeBox Version: 4.9.0\n\npersistence-elastic Hook Version: 5.2.0\n\nElasticsearch Version: 8.5.1 (issue occurs), 7.17.3 (works correctly)\n\nKubernetes Version: 1.28\n\nInstallation Method: Helm\n\n \n\n \n\nWorkaround\n\nCurrently, the only workaround is to downgrade Elasticsearch to version 7.17.x:\n\nhelm install elasticsearch elastic/elasticsearch \\\n\n  --version 7.17.3 \\\n\n  --namespace default\n\n \n\n \n\nHowever, this prevents users from:\n\n \n\nUsing Elasticsearch 8.x features\n\nFollowing Elasticsearch's recommended upgrade path\n\nReceiving security updates for Elasticsearch 8.x\n\nAdditional Context\n\nAffected scanners: All scanners that produce findings (Trivy, Semgrep, Nmap, custom scanners)\n\n \n\nChunk size impact: The error occurs when processing chunks of findings. In our testing:\n\n \n\n0 findings: Hook succeeds (no bulk operation)\n\n1-50 findings: Hook crashes on first bulk operation\n\n50+ findings: Hook crashes on first chunk (50 findings per chunk)\n\n \n\nrelated Elasticsearch migration documentation:\n\n \n\n[Elasticsearch 8.0 Breaking Changes](vscode-file://vscode-app/c:/Users/GKY24/Downloads/VSCode-win32-x64-1.104.1/resources/app/out/vs/code/electron-browser/workbench/workbench.html)\n\n[Elasticsearch Node.js Client Migration](vscode-file://vscode-app/c:/Users/GKY24/Downloads/VSCode-win32-x64-1.104.1/resources/app/out/vs/code/electron-browser/workbench/workbench.html)\n\n \n\nRequest\n\nPlease consider implementing the proposed backwards-compatible fix in the next release of the persistence-elastic hook. This will enable users to use Elasticsearch 8.x while maintaining compatibility with 7.x installations.\n\n \n\nThank you for maintaining this excellent project! 🙏","author":{"url":"https://github.com/conleth","@type":"Person","name":"conleth"},"datePublished":"2025-11-21T23:13:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3385/secureCodeBox/issues/3385"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0eb5a687-753d-0dee-7c87-a948be5e8fc1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE4A2:2D3E98:7540A9F:97AEBC1:6975B332
html-safe-nonce3093ee77c72db1f6f6547d25b0179bd4f27974e22253ba42228cdc838bd815dd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEEyOjJEM0U5ODo3NTQwQTlGOjk3QUVCQzE6Njk3NUIzMzIiLCJ2aXNpdG9yX2lkIjoiMzY5NjkwMzU4NDg4NTYzNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4a2b0c6b761e3ad5742c061f6d55adaecff78da33a814c0e7f8f32cd0df53375
hovercard-subject-tagissue:3653355188
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/secureCodeBox/secureCodeBox/3385/issue_layout
twitter:imagehttps://opengraph.githubassets.com/753b5f457a8cfb61eb022387b282727b40da738c873ae1350db5be89c89c1fa1/secureCodeBox/secureCodeBox/issues/3385
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/753b5f457a8cfb61eb022387b282727b40da738c873ae1350db5be89c89c1fa1/secureCodeBox/secureCodeBox/issues/3385
og:image:altDescription The persistence-elastic hook (version 5.2.0) fails when attempting to persist scan findings to Elasticsearch 8.x due to an API response format incompatibility. The hook works correctly ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameconleth
hostnamegithub.com
expected-hostnamegithub.com
None4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f
turbo-cache-controlno-preview
go-importgithub.com/secureCodeBox/secureCodeBox git https://github.com/secureCodeBox/secureCodeBox.git
octolytics-dimension-user_id34573705
octolytics-dimension-user_loginsecureCodeBox
octolytics-dimension-repository_id80711933
octolytics-dimension-repository_nwosecureCodeBox/secureCodeBox
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id80711933
octolytics-dimension-repository_network_root_nwosecureCodeBox/secureCodeBox
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release488b30e96dfd057fbbe44c6665ccbc030b729dde
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/secureCodeBox/secureCodeBox/issues/3385#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FsecureCodeBox%2FsecureCodeBox%2Fissues%2F3385
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FsecureCodeBox%2FsecureCodeBox%2Fissues%2F3385
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=secureCodeBox%2FsecureCodeBox
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/3385
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/3385
Reloadhttps://github.com/secureCodeBox/secureCodeBox/issues/3385
secureCodeBox https://github.com/secureCodeBox
secureCodeBoxhttps://github.com/secureCodeBox/secureCodeBox
Notifications https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Fork 175 https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Star 941 https://github.com/login?return_to=%2FsecureCodeBox%2FsecureCodeBox
Code https://github.com/secureCodeBox/secureCodeBox
Issues 72 https://github.com/secureCodeBox/secureCodeBox/issues
Pull requests 3 https://github.com/secureCodeBox/secureCodeBox/pulls
Discussions https://github.com/secureCodeBox/secureCodeBox/discussions
Actions https://github.com/secureCodeBox/secureCodeBox/actions
Projects 1 https://github.com/secureCodeBox/secureCodeBox/projects
Security 1 https://github.com/secureCodeBox/secureCodeBox/security
Insights https://github.com/secureCodeBox/secureCodeBox/pulse
Code https://github.com/secureCodeBox/secureCodeBox
Issues https://github.com/secureCodeBox/secureCodeBox/issues
Pull requests https://github.com/secureCodeBox/secureCodeBox/pulls
Discussions https://github.com/secureCodeBox/secureCodeBox/discussions
Actions https://github.com/secureCodeBox/secureCodeBox/actions
Projects https://github.com/secureCodeBox/secureCodeBox/projects
Security https://github.com/secureCodeBox/secureCodeBox/security
Insights https://github.com/secureCodeBox/secureCodeBox/pulse
New issuehttps://github.com/login?return_to=https://github.com/secureCodeBox/secureCodeBox/issues/3385
New issuehttps://github.com/login?return_to=https://github.com/secureCodeBox/secureCodeBox/issues/3385
#3391https://github.com/secureCodeBox/secureCodeBox/pull/3391
Elasticsearch 8.x compatibility issue: persistence-elastic hook fails with TypeError on bulk indexinghttps://github.com/secureCodeBox/secureCodeBox/issues/3385#top
#3391https://github.com/secureCodeBox/secureCodeBox/pull/3391
bugBugshttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/conleth
https://github.com/conleth
conlethhttps://github.com/conleth
on Nov 21, 2025https://github.com/secureCodeBox/secureCodeBox/issues/3385#issue-3653355188
bugBugshttps://github.com/secureCodeBox/secureCodeBox/issues?q=state%3Aopen%20label%3A%22bug%22
secureCodeBoxhttps://github.com/orgs/secureCodeBox/projects/6
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.