Cannot set property 'users' of undefined

Wappler Version : 4.9.1
Operating System : macOS Monterey 12.4
Server Model: nodejs
Database Type: postgres
Hosting Type: Wappler Local Server

Expected behavior

What do you think should happen?

When I add a database connection I should be able to use it

Actual behavior

What actually happens?

When I add a database connection and test the connection, everything is OK.

However, when I try to use the connection in a database query it says “No Valid Database Connection found! Please define it first in the Database Manager for this target”

When you look at the connection in the Database Manager there is an alert icon which says: “Cannot set property ‘users’ of undefined”

wappler_db_issue

There is only one table in the database and that happens to be the one it’s complaining about “users”.

How to reproduce

Add a new database connection
Test the connection - OK
Go to Database Manager and observe the warning message

I can confirm the problem also exists for me in Wappler v5.0.0-beta.7

I’m having the same issue using Wappler 4.91 on Windows 10
I create a new project, choose Docker and NodeJS.
In Project Settings, Database, I choose Postgres and leave everything as defaults.
On Saving Project Settings all the alerts look good and I have a full green circle against my ‘Target: Development’.
But when I open the Database Manager, the db, tables and views have a red circle with an exclamation mark and the hover over says ‘Cannot set property ‘cars’ of undefined’
There are no ‘Changes’ in the database.
Any pointers would be much appreciated.

Hi Wappler team, when can someone look at this issue? It’s holding me back from creating new projects. Thanks.

Are you using the direct database connection?
When you’re working with Api section (for example, create a query) you must have the database under globals.
image

Yup.

How is your configuration in globals - database connections - aws?
its pointed to local?
I use localhost in database server address and my domain in the target server url and works fine for me…


I’m connecting to an AWS postgres instance. The connection works fine when tested but still gives the error as per my first post above.

You are showing the DIRECT database connection…
Check your GLOBAL database connection

I’m a bit confused here. The database connection I showed above is the one in my global database connection.

In the global database connection (check the title, is not the “direct database connection”)
Change the host to: localhost, test connection, and try to make an api query

Also, check this topic Db database connection doesn't allow direct database connection

I dont know if aws works similar to others, but in some cases, you should give your ip on the trusted sources list, to allow the connection directly to your database like Cpanel uses “remote mysql”.
But, that is for direct database handling, not for creating apis on your site.

I appreciate the help, but the steps I’ve performed are the same ones I’ve done a bunch of times, and it always worked before.

Changing the host to localhost is not going to work as I don’t have a database running locally. I have other projects that access the same AWS database and they work fine.

There’s clearly a new bug that’s been introduced in setting up a new connection in a new nodejs, docker & postgres project.

Well, as you can see im not using a local server:

I guess the server is pointed in the target option:

Are you sure you have the correct server defined in the target option?
Of course it can be a bug, in that case i hope the team can read your post soon.

@George is there any chance one of your team can take a look into this issue? It’s holding me back from beginning my new project.

I’ve managed to make some progress. I clicked through to Tables (which was empty) and right clicked -> Refresh Schema. This brought up my users table which I’m now able to run queries against.

However, the alert and error message is still there.

image

Fixed in Wappler 5.1.2

This topic was automatically closed after 32 hours. New replies are no longer allowed.