我的。 Puma::HttpParserError:HTTP 格式无效,解析失败

问题描述 投票:0回答:1

我在Redmine 5.1.1中遇到了这个问题 Redmine 5.1.1(docker)

Environment:
  Redmine version                5.1.1.stable
  Ruby version                   3.2.3-p157 (2024-01-18) [x86_64-linux]
  Rails version                  6.1.7.6
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Tw-style (includes JavaScript)
SCM:
  Subversion                     1.14.2
  Mercurial                      6.3.2
  Bazaar                         3.3.2
  Git                            2.39.2
  Filesystem                     
  Gitlab                         4.14.0
Redmine plugins:
  redmine_agile                  1.6.6
  redmine_checklists             3.1.22
  redmine_gitlab_adapter         0.2.0
  redmine_hourglass              1.3.0-dev
  redmine_resources              2.0.0
  redmine_wysiwyg_editor         0.32.0
  redmineup_tags                 2.0.13

我有一个 php 脚本(PHP 8.2,通过 Redmine RestAPI),可以根据特定状态和跟踪器关闭 Redmine 中的任务。将Redmine更新到v. 5.1.1(旧v. 4.1.5)后,当我运行此脚本时,出现错误:

2024-02-27T08:13:14.382534085Z 2024-02-27 10:13:14 +0200 HTTP parse error, malformed request ("GET /issues.json" - (-)): #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
2024-02-27T08:13:14.384183564Z 2024-02-27 10:13:14 +0200 HTTP parse error, malformed request ("GET /issues.json" - (-)): #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
2024-02-27T08:13:14.385722548Z 2024-02-27 10:13:14 +0200 HTTP parse error, malformed request ("GET /issues.json" - (-)): #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>
2024-02-27T08:13:14.387330008Z 2024-02-27 10:13:14 +0200 HTTP parse error, malformed request ("GET /issues.json" - (-)): #<Puma::HttpParserError: Invalid HTTP format, parsing fails. Are you trying to open an SSL connection to a non-SSL Puma?>

我在另一台服务器上使用 nginx 反向代理来通过 https 使用 Redmine。以前版本的Redmine 4.1.5(没有Puma)在运行我的php脚本时工作得很好。 告诉我应该在配置中修复什么来消除此错误。 预先感谢您。

将 php 脚本配置从 https 更改为 http。

php redmine puma
1个回答
0
投票

最近问题 API 端点发生了变化,使其更加一致,如果您期望像“status=”(没有任何值)这样的内容,它可能会被破坏。查看相关票证这里

首先,您应该尝试使用 5.1.2,他们改进了此端点的行为,以便您可以检查问题是否出在 puma 端。

© www.soinside.com 2019 - 2024. All rights reserved.