HTTP::StateError: body has already been consumed
還沒有人認領這個 Issue。
評估
研究方向
使用 docker-compose、RSpec 環境和 spec/workers/activitypub/fetch_replies_worker_spec.rb,在 fork 的 Mastodon 設定中重現此失敗。從 appmap/hook/method/ruby3.rb,以及 app/lib/request.rb 和 app/helpers/jsonld_helper.rb 中顯示的 Mastodon 請求路徑開始。指定的 RSpec 測試在 APPMAP=true 下通過且沒有 HTTP::StateError 即表示完成。
由索引模型根據 Issue 內容生成。
描述
When running the latest AppMap gem on the Mastodon project, a handful of rspec tests will fail when APPMAP=true and will pass when APPMAP=false.
My Appmap yaml
---
name: mastodon
language: ruby
appmap_dir: tmp/appmap
packages:
- path: app
- path: lib
exclude:
- Request::ClientLimit#body_with_limit
- Request::ClientLimit#truncated_body
- ActivityPub::FetchRepliesWorker#perform
Stack Trace of Error
1) ActivityPub::FetchRepliesWorker perform performs a request if the collection URI is from the same host
Failure/Error: while (chunk = readpartial)
HTTP::StateError:
body has already been consumed
# ./.bundle/ruby/3.0.0/gems/http-5.1.1/lib/http/response/body.rb:67:in `stream!'
# ./.bundle/ruby/3.0.0/gems/http-5.1.1/lib/http/response/body.rb:29:in `readpartial'
# ./app/lib/request.rb:170:in `truncated_body'
# ./app/lib/request.rb:183:in `body_with_limit'
# ./app/helpers/jsonld_helper.rb:179:in `block in fetch_resource_without_id_validation'
# ./app/lib/request.rb:73:in `perform'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:40:in `bind_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:40:in `do_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:49:in `trace_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:16:in `call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:63:in `block in hook_method_def'
# ./app/helpers/jsonld_helper.rb:176:in `fetch_resource_without_id_validation'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:40:in `bind_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:40:in `do_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:49:in `trace_call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:16:in `call'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/hook/method/ruby3.rb:63:in `block in hook_method_def'
# ./app/services/activitypub/fetch_replies_service.rb:39:in `fetch_collection'
# ./app/services/activitypub/fetch_replies_service.rb:21:in `collection_items'
# ./app/services/activitypub/fetch_replies_service.rb:10:in `call'
# ./app/workers/activitypub/fetch_replies_worker.rb:10:in `perform'
# ./spec/workers/activitypub/fetch_replies_worker_spec.rb:25:in `block (3 levels) in <top (required)>'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/rspec.rb:251:in `instance_exec'
# ./.bundle/ruby/3.0.0/gems/appmap-0.100.0/lib/appmap/rspec.rb:251:in `block in wrap_example_block'
# ./.bundle/ruby/3.0.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
To recreate:
Clone the forked version of Mastodon
Start docker and run
$ docker-compose up -d db redis
Source the rspec env vars
$ source .env-rspec
Setup the DB
bundle exec rails db:setup
Run one of the tests that will fail:
RAILS_ENV=test DISABLE_SPRING=true bundle exec rspec ./spec/workers/activitypub/fetch_replies_worker_spec.rb
- 主要語言
- Ruby
- 星號
- 101
- 分支
- 13
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getappmap/appmap-ruby 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 30/100
getappmap/appmap-ruby#363 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 42/100
getappmap/appmap-ruby#360 ·
-
enhancement
難度 3/5 1-2 天 新手友好度 45/100
getappmap/appmap-ruby#357 ·
-
bug
難度 4/5 3-5 天 新手友好度 45/100
getappmap/appmap-ruby#355 ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
getappmap/appmap-ruby#344 · 2 則留言 · 1 個 reaction ·
查看 getappmap/appmap-ruby 的全部 Issue
相似的 Issue
-
Remove leftover Cloud66 custom_web process from Procfile可能已有人在做 @ShahadatTest 今天認領。 未關閉Difficulty: Easy Good First Issue
難度 1/5 1 小時以內 新手友好度 88/100
rubyforgood/casa#7330 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug needs-triaging
難度 2/5 1-3 小時 新手友好度 70/100
SeleniumHQ/seleniumhq.github.io#2952 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
hashicorp/homebrew-tap#433 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 8 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆