HTTP::StateError: body has already been consumed
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Reproduziere den Fehler im geforkten Mastodon-Setup mit docker-compose, der RSpec-Umgebung und spec/workers/activitypub/fetch_replies_worker_spec.rb. Beginne mit appmap/hook/method/ruby3.rb und den in app/lib/request.rb und app/helpers/jsonld_helper.rb gezeigten Mastodon-Request-Pfaden. Als abgeschlossen gilt die Aufgabe, wenn der angegebene RSpec-Test mit APPMAP=true ohne den HTTP::StateError erfolgreich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Ruby
- Sterne
- 101
- Forks
- 13
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getappmap/appmap-ruby
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
getappmap/appmap-ruby#363 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 42/100
getappmap/appmap-ruby#360 ·
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
getappmap/appmap-ruby#357 ·
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
getappmap/appmap-ruby#355 ·
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
getappmap/appmap-ruby#344 · 2 Kommentare · 1 Reaktion ·
Alle Issues in getappmap/appmap-ruby
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
notch8/iiif_print#430 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ActionText::Content#to_markdown: <br> in a table cell and empty <tr> produce malformed Markdown tablesEvtl. vergeben @azmi2409 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
vjeantet/homebrew-tap#4 ·
-
kotlin-lsp is missingOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
JetBrains/homebrew-utils#21 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ublue-os/homebrew-experimental-tap#774 ·
Maintainer antworten meist innerhalb von 1 Tag