Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'isView' of undefined #35

Closed
ashankasr opened this issue May 31, 2018 · 11 comments
Closed

Cannot read property 'isView' of undefined #35

ashankasr opened this issue May 31, 2018 · 11 comments
Labels
🐛 Type: Bug Something is broken or incorrect unexpectedly.

Comments

@ashankasr
Copy link

Hi All,

Here are my dev environment details.

  • node: v10.2.1
  • npm: 5.6.0
  • mysql: 8.0
  • xmysql: 0.4.5

Tried to generate the API for the a basic database with a single table with two columns. I got the following error:

Call Stack

(node:3444) [DEP0095] DeprecationWarning: timers.enroll() is deprecated. Please use setTimeout instead.
(node:3444) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.
C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Parser.js:80
throw err; // Rethrow non-MySQL errors
^

TypeError: Cannot read property 'isView' of undefined
at Xsql.iterateToCacheTables (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\lib\xsql.js:75:74)
at Query.self.pool.query [as _callback] (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\lib\xsql.js:46:14)
at Query.Sequence.end (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Sequence.js:88:24)
at Query._handleFinalResultPacket (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Query.js:139:8)
at Query.EofPacket (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Query.js:123:8)
at Protocol._parsePacket (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Protocol.js:279:23)
at Parser.write (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Parser.js:76:12)
at Protocol.write (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Protocol.js:39:16)
at Socket. (C:\Users\ashan\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\Connection.js:103:28)
at Socket.emit (events.js:182:13)


@o1lab
Copy link
Member

o1lab commented May 31, 2018

@ashankasr : looks like it is compatibility with mysql v8.0.

I haven;t tested it with mysql v8.0.

Could you please paste this from your mysql console

describe information_schema.VIEWS;

@o1lab
Copy link
Member

o1lab commented Jun 14, 2018

( .. ran into mysqljs connectivity issue whilst setting up mysql 8. Will give it a try later )

@tmlzx
Copy link

tmlzx commented Jul 12, 2018

How to solve this problem

@asllamas
Copy link

I've the same problem, any solution?

@o1lab
Copy link
Member

o1lab commented Jul 20, 2018

@tmlzx @asllamas : could you please paste the error stack you are seeing.

I tried connecting to mysql8 on my machine and encountered following error from mysql module

Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

This looks like issue in npm module mysql - and they are resolving this issue here - mysqljs/mysql#1962. Once this is resolved I will have a look.

Note:
Mysql workbench 6.x.x had issues connecting to mysql 8 server. Had to update workbench to latest dev version 8.0.1 to connect.

@asllamas
Copy link

asllamas commented Jul 20, 2018

The error:

 Generating REST APIs at the speed of your thought..

C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Parser.js:80
        throw err; // Rethrow non-MySQL errors
        ^

TypeError: Cannot read property 'isView' of undefined
    at Xsql.iterateToCacheTables (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\lib\xsql.js:75:74)
    at Query.self.pool.query (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\lib\xsql.js:46:14)
    at Query.<anonymous> (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\Connection.js:502:10)
    at Query._callback (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\Connection.js:468:16)
    at Query.Sequence.end (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Sequence.js:83:24)
    at Query._handleFinalResultPacket (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Query.js:139:8)
    at Query.EofPacket (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\sequences\Query.js:123:8)
    at Protocol._parsePacket (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Protocol.js:278:23)
    at Parser.write (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Parser.js:76:12)
    at Protocol.write (C:\Users\alex\AppData\Roaming\npm\node_modules\xmysql\node_modules\mysql\lib\protocol\Protocol.js:38:16)

@o1lab
Copy link
Member

o1lab commented Jul 20, 2018

@asllamas : thank you.

Could you please paste the output of the following mysql query on your machine. This will be helpful.

describe information_schema.VIEWS;

Note:
Strangely, from your and original log in this issue - it appears mysql connection was made successfully(!) and there was an issue with reading views table. However with my setup - it is failing to connect.

@asllamas
Copy link

Field,Type,Null,Key,Default,Extra
TABLE_CATALOG,varchar(64),YES,,NULL,
TABLE_SCHEMA,varchar(64),YES,,NULL,
TABLE_NAME,varchar(64),YES,,NULL,
VIEW_DEFINITION,longtext,YES,,NULL,
CHECK_OPTION,"enum('NONE','LOCAL','CASCADED')",YES,,NULL,
IS_UPDATABLE,"enum('NO','YES')",YES,,NULL,
DEFINER,varchar(93),YES,,NULL,
SECURITY_TYPE,varchar(7),YES,,NULL,
CHARACTER_SET_CLIENT,varchar(64),NO,,NULL,
COLLATION_CONNECTION,varchar(64),NO,,NULL,

@o1lab o1lab closed this as completed in 5ffa983 Jul 21, 2018
@o1lab o1lab reopened this Jul 21, 2018
@o1lab
Copy link
Member

o1lab commented Jul 21, 2018

@asllamas: Thank you. Please check if latest version of xmysql is of any help.

There was an issue accessing isView property which was overlooked (as I am still not clear on how xmysql is able to access mysql 8)

Update or install latest xmysql (0.4.8)

npm update -g xmysql

Please let me know the result.

@o1lab o1lab added the 🐛 Type: Bug Something is broken or incorrect unexpectedly. label Jul 21, 2018
@asllamas
Copy link

works perfectly! , thank you

@o1lab o1lab closed this as completed Jul 22, 2018
@jejDev
Copy link

jejDev commented Feb 23, 2019

Can you upgrade on docker please? Thank you!

akbarpasha pushed a commit to akbarpasha/nocodb that referenced this issue Nov 15, 2021
There was an error reading isView.
mustafapc19 pushed a commit that referenced this issue Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something is broken or incorrect unexpectedly.
Projects
None yet
Development

No branches or pull requests

5 participants