Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #2003
Closed
Open
Issue created Mar 24, 2021 by Administrator@rootContributor

Progress emitter throws error if jobId has comma in it

Created by: abdatta

I'm getting an error when I set a jobId that has a comma in it.

SyntaxError: Unexpected token h in JSON at position 2
    at JSON.parse (<anonymous>)
    at Redis.messageHandler (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/bull/lib/queue.js:404:50)
    at Redis.emit (events.js:315:20)
    at DataHandler.handleSubscriberReply (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/ioredis/built/DataHandler.js:80:32)
    at DataHandler.returnReply (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/ioredis/built/DataHandler.js:47:18)
    at JavascriptRedisParser.returnReply (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/ioredis/built/DataHandler.js:21:22)
    at JavascriptRedisParser.execute (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/redis-parser/lib/parser.js:544:14)
    at Socket.<anonymous> (/usr/lib/node_modules/@abdatta/bulls-eye/node_modules/ioredis/built/DataHandler.js:25:20)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)

On following the error message, I end up on this line https://github.com/OptimalBits/bull/blob/4177e57f5a167e89cd6de08ac19cc755757fc158/lib/queue.js#L404

I see the code tried to extract the jobId using the location of the first comma, but since the jobId itself has a comma in it, it fails the extract the full jobId, and the remaining text is not parseable by JSON.parse.

I need to fix this urgently since a code in production is breaking. I would be grateful if somebody can guide be on how to best fix this.

Assignee
Assign to
Time tracking