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

Adding related issue causes error 422 (authenticity token invalid) #192

Open
leoniscsem opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@leoniscsem
Copy link

Environment:
  Redmine version                5.1.3.stable
  Ruby version                   3.1.6-p260 (2024-05-29) [x86_64-linux]
  Rails version                  6.1.7.8
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Purplemine2 (includes JavaScript)
SCM:
  Git                            2.34.1
  Filesystem                     
Redmine plugins:
  additional_tags                3.4.0
  additionals                    3.4.0  # branch stable
  easy_baseline                  2.0
  easy_gantt                     2.0
  easy_gantt_pro                 2.0
  easy_mindmup                   2.0
  easy_wbs                       2.0
  mega_calendar                  2.0tail .0
  redmine_agile                  1.6.9
  redmine_issue_dynamic_edit     0.9.1
  redmine_mentions               0.0.1
  redmine_messenger              1.0.15
  redmine_rt                     1.1.1
  redmine_wiki_text_encloser     0.2.1

When trying to link an issue to another issue the user gets logged out and Redmine throws error 422. I cannot tell if this is caused by my Nginx configuration (see Can't verify CSRF token authenticity) or by the plugin itself. I have manually deleted the plugin from the database and reinstalled it, but the error persists.

grafik

production.log

I, [2024-12-19T13:05:02.004725 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] Started POST "/issues/37/relations" for XXX.XXX.XXX.XXX at 2024-12-19 13:05:02 +0800
I, [2024-12-19T13:05:02.005767 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] Processing by IssueRelationsController#create as HTML
I, [2024-12-19T13:05:02.005852 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Parameters: {"utf8"=>"✓", "relation"=>{"relation_type"=>"relates", "issue_to_id"=>"50, ", "delay"=>""}, "commit"=>"Add", "issue_id"=>"37"}
W, [2024-12-19T13:05:02.006057 #568733]  WARN -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] Can't verify CSRF token authenticity.
E, [2024-12-19T13:05:02.006187 #568733] ERROR -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken
D, [2024-12-19T13:05:02.008610 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   AnonymousUser Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 AND "users"."lastname" = $2 LIMIT $3  [["type", "AnonymousUser"], ["lastname", "Anonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.009800 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendering layout layouts/base.html.erb
D, [2024-12-19T13:05:02.009898 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendering common/error.html.erb within layouts/base
I, [2024-12-19T13:05:02.010214 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered common/error.html.erb within layouts/base (Duration: 0.2ms | Allocations: 55)
D, [2024-12-19T13:05:02.013458 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/redmine_wiki_text_encloser/app/views/wiki_text_encloser/_base.html.erb (Duration: 0.3ms | Allocations: 100)
D, [2024-12-19T13:05:02.014248 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/additional_tags/app/views/additional_tags/_html_head.html.slim (Duration: 0.5ms | Allocations: 362)
D, [2024-12-19T13:05:02.014900 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/additionals/app/views/additionals/_html_head.html.slim (Duration: 0.4ms | Allocations: 328)
D, [2024-12-19T13:05:02.016679 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/additionals/app/views/additionals/_body_top.slim (Duration: 0.1ms | Allocations: 39)
D, [2024-12-19T13:05:02.019534 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Role Load (0.9ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9) AND "members"."user_id" = 4
D, [2024-12-19T13:05:02.020857 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   GroupAnonymous Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.023503 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Role Load (1.4ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.024863 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Role Load (0.3ms)  SELECT "roles".* FROM "roles" WHERE "roles"."builtin" = $1 LIMIT $2  [["builtin", 2], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.026264 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   GroupAnonymous Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY id LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.027331 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]    (0.2ms)  SELECT "users"."id" FROM "users" WHERE "users"."type" = $1 LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.029098 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]    (0.7ms)  SELECT "members"."user_id", "role_id", "members"."project_id" FROM "members" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" INNER JOIN "member_roles" ON "member_roles"."member_id" = "members"."id" WHERE (projects.status <> 9) AND (members.user_id = 4 OR (projects.is_public = TRUE AND members.user_id = 2))
D, [2024-12-19T13:05:02.031150 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   EnabledModule Exists? (0.9ms)  SELECT 1 AS one FROM "enabled_modules" WHERE "enabled_modules"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE (((projects.status <> 9 AND projects.status <> 10) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (4,2))))))) AND "enabled_modules"."name" = $1 LIMIT $2  [["name", "issue_tracking"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.032007 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.033040 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE Role Load (0.0ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.033937 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY id LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.035169 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   EnabledModule Exists? (0.5ms)  SELECT 1 AS one FROM "enabled_modules" WHERE "enabled_modules"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE (((projects.status <> 9 AND projects.status <> 10) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (4,2))))))) AND "enabled_modules"."name" = $1 LIMIT $2  [["name", "time_tracking"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.035821 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.036555 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE Role Load (0.0ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.037052 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY id LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.038239 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   EnabledModule Exists? (0.5ms)  SELECT 1 AS one FROM "enabled_modules" WHERE "enabled_modules"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE (((projects.status <> 9 AND projects.status <> 10) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (4,2))))))) AND "enabled_modules"."name" = $1 LIMIT $2  [["name", "gantt"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.038850 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.039607 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE Role Load (0.0ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.040127 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY id LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.041543 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   EnabledModule Exists? (0.5ms)  SELECT 1 AS one FROM "enabled_modules" WHERE "enabled_modules"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE (((projects.status <> 9 AND projects.status <> 10) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (4,2))))))) AND "enabled_modules"."name" = $1 LIMIT $2  [["name", "calendar"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.042124 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.042820 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE Role Load (0.0ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.043309 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY id LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.044534 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   EnabledModule Exists? (0.5ms)  SELECT 1 AS one FROM "enabled_modules" WHERE "enabled_modules"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE (((projects.status <> 9 AND projects.status <> 10) AND ((projects.is_public = TRUE AND projects.id NOT IN (SELECT project_id FROM members WHERE user_id IN (4,2))))))) AND "enabled_modules"."name" = $1 LIMIT $2  [["name", "news"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.045096 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE GroupAnonymous Load (0.0ms)  SELECT "users".* FROM "users" WHERE "users"."type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["type", "GroupAnonymous"], ["LIMIT", 1]]
D, [2024-12-19T13:05:02.045792 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   CACHE Role Load (0.0ms)  SELECT DISTINCT "roles".* FROM "roles" INNER JOIN "member_roles" ON "member_roles"."role_id" = "roles"."id" INNER JOIN "members" ON "members"."id" = "member_roles"."member_id" INNER JOIN "projects" ON "projects"."id" = "members"."project_id" WHERE (projects.status <> 9 AND projects.is_public = TRUE) AND "members"."user_id" = 2
D, [2024-12-19T13:05:02.047378 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/additional_tags/app/views/additional_tags/_body_bottom.html.slim (Duration: 0.5ms | Allocations: 391)
D, [2024-12-19T13:05:02.047758 #568733] DEBUG -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered plugins/additionals/app/views/additionals/_body_bottom.html.slim (Duration: 0.1ms | Allocations: 47)
I, [2024-12-19T13:05:02.048675 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c]   Rendered layout layouts/base.html.erb (Duration: 38.8ms | Allocations: 11979)
I, [2024-12-19T13:05:02.048886 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] Filter chain halted as :verify_authenticity_token rendered or redirected
I, [2024-12-19T13:05:02.049051 #568733]  INFO -- : [c73ffd36-3755-48ed-adf3-3fb16c53678c] Completed 422 Unprocessable Entity in 43ms (Views: 32.0ms | ActiveRecord: 7.8ms | Allocations: 12947)

Any other log I can provide to find the issue cause? Thank you.

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

No branches or pull requests

1 participant