question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading to 14.6.0 breaks column metadata. "Unexpected token `COLMETADATA`"

See original GitHub issue

Software versions

  • Tedious: 14.6.0
  • SQL Server: SQL Server 2016
  • Node.js: 16.15.0

Additional Libraries Used and Versions chriseaton/rhino

Problem description As soon as we upgrade to 14.6.0, our tedious calls break with the following error:

UnexpectedTokenError: Unexpected token `COLMETADATA` in `Login7TokenHandler`
    at Login7TokenHandler.onColMetadata (/app/node_modules/tedious/lib/token/handler.js:91:11)
    at Readable.<anonymous> (/app/node_modules/tedious/lib/token/token-stream-parser.js:26:33)
    at Readable.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Readable.push (node:internal/streams/readable:228:10)
    at next (node:internal/streams/from:98:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Emitted 'error' event on Readable instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

When we force the version back to 14.5.0 the problem goes away. The release doesn’t say anything about column metadata handling changing, so are unsure why this is happening.

Here is our relevant code that traps the events from a query - this works prior to 14.6.0. https://github.com/chriseaton/rhino/blob/master/connected-query.js#L104-L179

Expected behavior The query to execute and get column metadata OK.

Actual behavior Crash before any events fire.

Any other details that can be helpful

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
arthurschreibercommented, Jun 13, 2022

We refactored some internals to use async/await, and this might somehow be related to that. The COLMETADATA token should never be part of the LOGIN7 response, so I think we’re switching the state somewhere too early/too late.

@mShan0 Mind taking a look?

0reactions
mShan0commented, Jun 22, 2022

@RickOldenburger I believe that every release of Tedious is tagged as next for 7 days, then it becomes the latest/current. 14.6.1 should become the latest within the next 3-4 days and then you can do a standard install

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rails JSON.parse "unexpected token" error - Stack Overflow
I have a simple controller that is hit by webhooks. I need to store all data sent in a model's metadata which is...
Read more >
Troubleshooting Omnibus GitLab installation issues
Ignoring errors can have unexpected side effects on the performance of your ... These sync failures are caused by issues with the metadata...
Read more >
tediousjs tedious Issues - Giters
Upgrading to 15.0.0 causes performance issues. Updated 2 months ago 6 ... Upgrading to 14.6.0 breaks column metadata. "Unexpected token `COLMETADATA`".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found