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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #29027 - session_id out of range error #7441

Merged
merged 1 commit into from Feb 18, 2020

Conversation

ezr-ondrej
Copy link
Member

Session id is out of range for some users, probably because a lot of API requests.
This solves it for PostgreSQL and most likely even for MySQL (if we would get back to it in the future 馃檭)

@theforeman-bot
Copy link
Member

Issues: #29027

@tbrisker
Copy link
Member

Tests are failing due to rubocop

@ezr-ondrej
Copy link
Member Author

Tests are failing due to rubocop

Thanks for poking me :)

@ezr-ondrej
Copy link
Member Author

[test foreman]

@ezr-ondrej
Copy link
Member Author

[test katello]

@kgaikwad
Copy link
Member

Looks reasonable to me 馃憤

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ezr-ondrej and @kgaikwad !

@tbrisker tbrisker merged commit e058997 into theforeman:develop Feb 18, 2020
@ezr-ondrej ezr-ondrej deleted the fix_session_out_range branch February 18, 2020 14:59
@tbrisker
Copy link
Member

This is now failing on both PG and sqlite (with different errors), please fix or revert

@tbrisker
Copy link
Member

sqlite:

ActiveRecord::NotNullViolation (SQLite3::ConstraintException: NOT NULL constraint failed: sessions.id: INSERT INTO "sessions" ("session_id", "data", "created_at", "updated_at") VALUES (?, ?, ?, ?))

pg:

PG::InvalidParameterValue: ERROR:  MAXVALUE (9223372036854775807) is out of range for sequence data type integer
    ALTER SEQUENCE sessions_id_seq MAXVALUE 9223372036854775807 CYCLE;

@ezr-ondrej
Copy link
Member Author

pg is because of version of the database it seems. No idea what is happening in sqlite though

@ezr-ondrej
Copy link
Member Author

Followup in #7448

@kamils-iRonin
Copy link
Member

@ezr-ondrej It doesn't seem to work well with postgres 12. I noticed that the tests in one plugin I'm working on fail with the following error: The process '/opt/hostedtoolcache/Ruby/2.6.5/x64/bin/bundle' failed with exit code 1. Here's the broken build:
https://github.com/kamils-iRonin/foreman_git_templates/runs/457264450?check_suite_focus=true
I was able to fix the build with this change:
kamils-iRonin@8ab834a
And fixed build:
https://github.com/kamils-iRonin/foreman_git_templates/runs/458233042?check_suite_focus=true
Can you please take a look?

@kamils-iRonin
Copy link
Member

It was a problem with parsing the PG version. Fixed here: #7457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants