GithubHelp home page GithubHelp logo

Comments (8)

keesvanbemmel avatar keesvanbemmel commented on July 20, 2024 4

The fix has not been released yet, so that seems right

from directus.

keesvanbemmel avatar keesvanbemmel commented on July 20, 2024 3

So yeah, issue is resurfacing and I think I know where the problem lies:

After migrations we apply our own schema. When applying this schema the schema diff tells us that it will remove next_token from directus_sessions.

Now I know in the past, that these directus fields should be excluded from the diff alltogether? So definitely seems like a bug

from directus.

paescuj avatar paescuj commented on July 20, 2024

Did you run the migration 1 when updating to 10.11.1?

Footnotes

  1. https://docs.directus.io/self-hosted/upgrades-migrations.html#upgrading-updating-a-project

from directus.

keesvanbemmel avatar keesvanbemmel commented on July 20, 2024

Yes I did, happens through our CICD pipeline. This is the migration that got logged:
CleanShot 2024-05-27 at 11 48 34

from directus.

keesvanbemmel avatar keesvanbemmel commented on July 20, 2024

Ok, something weird happened. I looked at the migrations table and the Add Session Window was there. However the directus_sessions table didn't have a next_token column.

Reran the migration and not it works. No further action needed. Strange though.

from directus.

paescuj avatar paescuj commented on July 20, 2024

Good catch! Thanks @keesvanbemmel!

from directus.

ricricucit avatar ricricucit commented on July 20, 2024

Just updated to 10.11.2, and confirm the resurfacing. Getting this while trying to log in:

database-1  | 2024-05-31 15:08:54.780 UTC [62] ERROR:  column s.next_token does not exist at character 44
database-1  | 2024-05-31 15:08:54.780 UTC [62] STATEMENT:  select "s"."expires" as "session_expires", "s"."next_token" as "session_next_token", "u"."id" as "user_id", "u"."first_name" as "user_first_name", "u"."last_name" as "user_last_name", "u"."email" as "user_email", "u"."password" as "user_password", "u"."status" as "user_status", "u"."provider" as "user_provider", "u"."external_identifier" as "user_external_identifier", "u"."auth_data" as "user_auth_data", "r"."id" as "role_id", "r"."admin_access" as "role_admin_access", "r"."app_access" as "role_app_access", "d"."id" as "share_id", "d"."item" as "share_item", "d"."role" as "share_role", "d"."collection" as "share_collection", "d"."date_start" as "share_start", "d"."date_end" as "share_end", "d"."times_used" as "share_times_used", "d"."max_uses" as "share_max_uses" from "directus_sessions" as "s" left join "directus_users" as "u" on "s"."user" = "u"."id" left join "directus_shares" as "d" on "s"."share" = "d"."id" left join "directus_roles" as "r" on "r"."id" in ("u"."role", "d"."role") where "s"."token" = $1 and "s"."expires" >= $2 and ("d"."date_end" is null or "d"."date_end" >= $3) and ("d"."date_start" is null or "d"."date_start" <= $4) limit $5
directus-1  | [15:08:54] POST /auth/refresh 500 115ms
directus-1  | [15:08:54.782] ERROR: select "s"."expires" as "session_expires", "s"."next_token" as "session_next_token", "u"."id" as "user_id", "u"."first_name" as "user_first_name", "u"."last_name" as "user_last_name", "u"."email" as "user_email", "u"."password" as "user_password", "u"."status" as "user_status", "u"."provider" as "user_provider", "u"."external_identifier" as "user_external_identifier", "u"."auth_data" as "user_auth_data", "r"."id" as "role_id", "r"."admin_access" as "role_admin_access", "r"."app_access" as "role_app_access", "d"."id" as "share_id", "d"."item" as "share_item", "d"."role" as "share_role", "d"."collection" as "share_collection", "d"."date_start" as "share_start", "d"."date_end" as "share_end", "d"."times_used" as "share_times_used", "d"."max_uses" as "share_max_uses" from "directus_sessions" as "s" left join "directus_users" as "u" on "s"."user" = "u"."id" left join "directus_shares" as "d" on "s"."share" = "d"."id" left join "directus_roles" as "r" on "r"."id" in ("u"."role", "d"."role") where "s"."token" = $1 and "s"."expires" >= $2 and ("d"."date_end" is null or "d"."date_end" >= $3) and ("d"."date_start" is null or "d"."date_start" <= $4) limit $5 - column s.next_token does not exist
directus-1  |     err: {
directus-1  |       "type": "DatabaseError",
directus-1  |       "message": "select \"s\".\"expires\" as \"session_expires\", \"s\".\"next_token\" as \"session_next_token\", \"u\".\"id\" as \"user_id\", \"u\".\"first_name\" as \"user_first_name\", \"u\".\"last_name\" as \"user_last_name\", \"u\".\"email\" as \"user_email\", \"u\".\"password\" as \"user_password\", \"u\".\"status\" as \"user_status\", \"u\".\"provider\" as \"user_provider\", \"u\".\"external_identifier\" as \"user_external_identifier\", \"u\".\"auth_data\" as \"user_auth_data\", \"r\".\"id\" as \"role_id\", \"r\".\"admin_access\" as \"role_admin_access\", \"r\".\"app_access\" as \"role_app_access\", \"d\".\"id\" as \"share_id\", \"d\".\"item\" as \"share_item\", \"d\".\"role\" as \"share_role\", \"d\".\"collection\" as \"share_collection\", \"d\".\"date_start\" as \"share_start\", \"d\".\"date_end\" as \"share_end\", \"d\".\"times_used\" as \"share_times_used\", \"d\".\"max_uses\" as \"share_max_uses\" from \"directus_sessions\" as \"s\" left join \"directus_users\" as \"u\" on \"s\".\"user\" = \"u\".\"id\" left join \"directus_shares\" as \"d\" on \"s\".\"share\" = \"d\".\"id\" left join \"directus_roles\" as \"r\" on \"r\".\"id\" in (\"u\".\"role\", \"d\".\"role\") where \"s\".\"token\" = $1 and \"s\".\"expires\" >= $2 and (\"d\".\"date_end\" is null or \"d\".\"date_end\" >= $3) and (\"d\".\"date_start\" is null or \"d\".\"date_start\" <= $4) limit $5 - column s.next_token does not exist",
directus-1  |       "stack":
directus-1  |           error: select "s"."expires" as "session_expires", "s"."next_token" as "session_next_token", "u"."id" as "user_id", "u"."first_name" as "user_first_name", "u"."last_name" as "user_last_name", "u"."email" as "user_email", "u"."password" as "user_password", "u"."status" as "user_status", "u"."provider" as "user_provider", "u"."external_identifier" as "user_external_identifier", "u"."auth_data" as "user_auth_data", "r"."id" as "role_id", "r"."admin_access" as "role_admin_access", "r"."app_access" as "role_app_access", "d"."id" as "share_id", "d"."item" as "share_item", "d"."role" as "share_role", "d"."collection" as "share_collection", "d"."date_start" as "share_start", "d"."date_end" as "share_end", "d"."times_used" as "share_times_used", "d"."max_uses" as "share_max_uses" from "directus_sessions" as "s" left join "directus_users" as "u" on "s"."user" = "u"."id" left join "directus_shares" as "d" on "s"."share" = "d"."id" left join "directus_roles" as "r" on "r"."id" in ("u"."role", "d"."role") where "s"."token" = $1 and "s"."expires" >= $2 and ("d"."date_end" is null or "d"."date_end" >= $3) and ("d"."date_start" is null or "d"."date_start" <= $4) limit $5 - column s.next_token does not exist
directus-1  |               at Parser.parseErrorMessage (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:283:98)
directus-1  |               at Parser.handlePacket (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:122:29)
directus-1  |               at Parser.parse (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/parser.js:35:38)
directus-1  |               at Socket.<anonymous> (/directus/node_modules/.pnpm/[email protected]/node_modules/pg-protocol/dist/index.js:11:42)
directus-1  |               at Socket.emit (node:events:517:28)
directus-1  |               at addChunk (node:internal/streams/readable:368:12)
directus-1  |               at readableAddChunk (node:internal/streams/readable:341:9)
directus-1  |               at Readable.push (node:internal/streams/readable:278:10)
directus-1  |               at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
directus-1  |       "length": 110,
directus-1  |       "name": "error",
directus-1  |       "severity": "ERROR",
directus-1  |       "code": "42703",
directus-1  |       "position": "44",
directus-1  |       "file": "parse_relation.c",
directus-1  |       "line": "3713",
directus-1  |       "routine": "errorMissingColumn"
directus-1  |     }

from directus.

ricricucit avatar ricricucit commented on July 20, 2024

(reverting to 10.11.0 works fine and I do understand that this is going to be included only from next release, onward 🙂 thanks everyone)

from directus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.