Comments (13)
Let me reopen this issue, we should definitely support the latest Sequelize versions. It will push us to make it happen ;)
from forest-express-sequelize.
Ok, I think you upgraded your Sequelize version, am I wrong?
I think you forbid old Sequelize operators and that make Forest queries to be malformed.
See: http://docs.sequelizejs.com/manual/tutorial/querying.html#operators-aliases
Do you confirm it could be the reason?
from forest-express-sequelize.
Seems like sequelize dropping the old operators is a security measure.
It's probably a good idea to update forest accordingly.
from forest-express-sequelize.
@danielres, you're right, this is something we need to work on.
from forest-express-sequelize.
@danielres @TimAstier The fix is now available in the latest liana release 2.2.1
Thanks for the feedback,
🌲🌲🌲
from forest-express-sequelize.
Hey @danielres,
Did you upgrade to a new liana version?
It seems that the error appears in a strange segment or filter that generates this weird condition WHERE "User"."$and" IN (NULL)
.
Can you share a screenshot of the broken UI?
A screenshot of the request/payload in the Chrome console (Network tab) would be also very helpful.
Thank you for the feedback.
from forest-express-sequelize.
I made sure liana ("forest-express-sequelize": "^2.1.1"
) is at the latest version, didn't fix the issue.
Here are the screenshots, same problem with all the collections (Users, Profiles, Projects, Purchases):
Thank you for your help.
from forest-express-sequelize.
Can you share the "Headers" tab of the last screenshot, what is interesting to me is the format of the request and especially the payload sent. 🙏
from forest-express-sequelize.
sure
from forest-express-sequelize.
I've been trying to checkout different commits in the project's git history and find at which point the problem ocurs.
The problem seems to appear with a commit that does this:
Changes in our "init" migration (we keep 1 migration while we're in early dev mode, with dropping & migrating the whole db when the migration is changed, and restarting the server).
CREATE TABLE "User" (
"id" uuid primary key default uuid_generate_v4(),
+ "authId" varchar NOT NULL UNIQUE,
"firstName" varchar NOT NULL,
"lastName" varchar NOT NULL,
server/models/User.js file, used by forest and the rest of the app:
primaryKey: true,
},
+ authId: {
+ type: DataTypes.STRING,
+ allowNull: false,
+ },
firstName: {
type: DataTypes.STRING,
allowNull: false,
Before this change, the forest admin works fine.
Still don't undedrstand why this would be triggering the problem. Am I missing something ?
from forest-express-sequelize.
Thanks for sharing, it is really weird.
As the latest error your shared was on the "Projects" collection, can you share the SQL select query error on the "projects" table?
from forest-express-sequelize.
sure (I replaced some parts with "..." for confidentiality reasons)
OPTIONS /forest/Project?fields%5BProject%5D=name%2Cstatus%2Cdescription%2CcreatedAt%2CupdatedAt&page%5Bnumber%5D=1&page%5Bsize%5D=10&searchExtended=0&sort=-createdAt&timezone=Europe%2FBerlin 200 0.202 ms - 2
[1] [forest] 🌳🌳🌳 Unexpected error: column Project.$and does not exist
[1] SequelizeDatabaseError: column Project.$and does not exist
[1] at Query.formatError (.../node_modules/sequelize/lib/dialects/postgres/query.js:356:16)
[1] at query.catch.err (.../node_modules/sequelize/lib/dialects/postgres/query.js:86:18)
[1] at tryCatcher (.../node_modules/bluebird/js/release/util.js:16:23)
[1] at Promise._settlePromiseFromHandler (.../node_modules/bluebird/js/release/promise.js:512:31)
[1] at Promise._settlePromise (.../node_modules/bluebird/js/release/promise.js:569:18)
[1] at Promise._settlePromise0 (.../node_modules/bluebird/js/release/promise.js:614:10)
[1] at Promise._settlePromises (.../node_modules/bluebird/js/release/promise.js:689:18)
[1] at Async._drainQueue (.../node_modules/bluebird/js/release/async.js:133:16)
[1] at Async._drainQueues (.../node_modules/bluebird/js/release/async.js:143:10)
[1] at Immediate.Async.drainQueues [as _onImmediate] (.../node_modules/bluebird/js/release/async.js:17:14)
[1] at runCallback (timers.js:773:18)
[1] at tryOnImmediate (timers.js:734:5)
[1] at processImmediate [as _immediateCallback] (timers.js:711:5)
[2] db_1 | 2018-01-25 14:32:22.872 UTC [81] ERROR: column Project.$and does not exist at character 84
[2] db_1 | 2018-01-25 14:32:22.872 UTC [81] STATEMENT: SELECT count("Project"."id") AS "count" FROM "public"."Project" AS "Project" WHERE "Project"."$and" IN (NULL);
[2] db_1 | 2018-01-25 14:32:22.872 UTC [80] ERROR: column Project.$and does not exist at character 125
[2] db_1 | 2018-01-25 14:32:22.872 UTC [80] STATEMENT: SELECT "id", "userId", "status", "name", "description", "createdAt", "updatedAt" FROM "public"."Project" AS "Project" WHERE "Project"."$and" IN (NULL) ORDER BY "Project"."createdAt" DESC LIMIT 10 OFFSET 0;
[1] GET /forest/Project?fields%5BProject%5D=name%2Cstatus%2Cdescription%2CcreatedAt%2CupdatedAt&page%5Bnumber%5D=1&page%5Bsize%5D=10&searchExtended=0&sort=-createdAt&timezone=Europe%2FBerlin 500 12.665 ms - 73
from forest-express-sequelize.
indeed, locking sequelize to version 4.8.0
solves the problem (instead of ^4.28.6
).
Thank you for the great support !
from forest-express-sequelize.
Related Issues (20)
- Smart action hook previousValue wrongly set HOT 1
- The LianaOption "expressParentApp" is not described in the library's types HOT 2
- Typescript typing HOT 1
- Invalid usage of the option NEXT in the FETCH when creating an object HOT 4
- TypeError: Cannot read property 'replace' of null HOT 2
- Unexpected error: attribute.split is not a function HOT 2
- "column does not exist" after upgrade to 3.6.8 HOT 11
- "Create a new [entity]" sets the new entity to all the relations of kind [entity] HOT 1
- Relations (Has many getter) not returning data for rows HOT 2
- Format values, tooltips and legends in API-based charts HOT 5
- Type SmartActionLoadHook does not support async function
- Height Truncated in View Content
- Connection refused by port 3310 HOT 1
- Smart Actions No Longer Working
- Can't override route using ForestRequest in TypeScript
- Segments no longer working
- Can't use import syntax (ES6 module) in the Forest Folder
- Not correct display of default values for a field of type JSONB
- forest/authentication route returns 404
- How to configure this for local environment? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forest-express-sequelize.