HTTP::StateError: body has already been consumed
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Reproduisez l’échec dans la configuration forkée de Mastodon avec docker-compose, l’environnement RSpec et spec/workers/activitypub/fetch_replies_worker_spec.rb. Commencez par appmap/hook/method/ruby3.rb et les chemins de requête de Mastodon indiqués dans app/lib/request.rb et app/helpers/jsonld_helper.rb. Le travail est terminé lorsque le test RSpec spécifié réussit avec APPMAP=true sans HTTP::StateError.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Ruby
- Étoiles
- 101
- Forks
- 13
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getappmap/appmap-ruby
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
getappmap/appmap-ruby#363 · 2 commentaires ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
getappmap/appmap-ruby#360 ·
-
enhancement
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
getappmap/appmap-ruby#357 ·
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
getappmap/appmap-ruby#355 ·
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
getappmap/appmap-ruby#344 · 2 commentaires · 1 réaction ·
Toutes les issues de getappmap/appmap-ruby
Issues similaires
-
Component: Ruby Type: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
chore
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
AllYourBot/hostedgpt#818 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[bug]: Sticky Streak DisappearedOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Použiť Redis pre ActionCableOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
slovensko-digital/autogram-portal#392 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
voxpupuli/puppet-quadlets#122 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour