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.

InvalidData: data did not match any variant of untagged enum ArgsEnum

See original GitHub issue

Hello there

I was using this module before on linux on Deno 1.1.0 with no problems, but when I switched to windows (with different deno code), I started getting this error:

INFO connecting api.iceproductions.dev:3306
Error loading table data: InvalidData: data did not match any variant of untagged enum ArgsEnum
    at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:98:10)
    at async Object.connect ($deno$/net.ts:182:11)
    at async Connection._connect (https://deno.land/x/mysql/src/connection.ts:45:17)
    at async Connection.connect (https://deno.land/x/mysql/src/connection.ts:82:5)
    at async Client.createConnection (https://deno.land/x/mysql/src/client.ts:45:5)
    at async DeferredStack.pop (https://deno.land/x/mysql/src/deferred.ts:33:20)
    at async Client.useConnection (https://deno.land/x/mysql/src/client.ts:109:24)
    at async Client.query (https://deno.land/x/mysql/src/client.ts:89:12)

I have no idea why, and the only thing I found was on SO telling me to never use master branch, rather use release with version support, however using latest release (2.2.0) didn’t change anything. Any ideas if I’m doing something wrong?

My code is (when simplified)

const pool = await new Client().connect({
    hostname: config.mysql.host,
    username: config.mysql.username,
    db: config.mysql.database,
    password: config.mysql.password,
    port: config.mysql.port
});


var resp = await pool.query("SHOW tables"); // <-- fails here

All of config is from user input, everything except port is of type string.

Versions:

   12GB RAM (11.9GB usable),
    Intel i5
    Win 10 (v2004, build 19041.239)
    deno 1.1.0
    v8 8.4.300
    typescript 3.9.2
    10.4.12-MariaDB-1:10.4.12+maria~bionic-log

Note that the same server (MariaDB) worked just fine when connecting from linux (and in fact, I’m connected to it right now from local adminer so connection itself should work too).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jpetersecommented, Jul 24, 2020

I ran into this issue today, using Deno 1.2.0 and mySQL 2.3.0.

It happens when port number is provided as a string. ClientConfig defines Port to be of type number. Specifying the port number as a number, solves the issue.

0reactions
danbulantcommented, Apr 5, 2021

to help the maintainers, I’ll close the issue (I’m no longer using mysql and this issue was stale for while).

Read more comments on GitHub >

github_iconTop Results From Across the Web

data did not match any variant of untagged enum ArgsEnum ...
Found a tutorial on building a REST API here. So, when I'm trying to run it, I get this InvalidData error: error: Uncaught...
Read more >
data did not match any variant of untagged enum ...
InvalidArgumentException : data did not match any variant of untagged enum PointerActionItem (ELEMENT in PointerOrigin)
Read more >
How to create a REST API with Deno and Postgres
Here's how to create a complete CRUD-like API with Deno and Postgres without relying on Node.js or the node_modules directory.
Read more >
Deploy your Deno apps to Heroku - DEV Community ‍ ‍
Ok, The first we need to have a Deno application. if you didn't download Deno ... data did not match any variant of...
Read more >
User Sventies - Server Fault
This user doesn't have any silver badges yet. ... Uncaught InvalidData: data did not match any variant of untagged enum ArgsEnum ...
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