Skip to content

microcule + x-ray + docker streaming error #34

@mikaelkaron

Description

@mikaelkaron

While trying to implement a microcule powered scraper I've run in to what looks like a broken stream problem, but only if the whole thing is hosted in a docker container (I know, there's a few deps here that could be the root cause but I figured asking for help can't hurt).

To reproduce clone the gist from above:

git clone https://gist.github.com/d10ee3863a6f0773c5386b77abea77fa.git

Build the docker image:

docker build -t microcule-docker

Run the docker image in interactive terminal:

docker run -it -p 3000:3000 microcule-docker

After this hit the following URL's:

http://localhost:3000/request/hook
http://localhost:3000/scrape/hook
http://localhost:3000/scrape/middleware

The second URL breaks in the middle of the JSON. However if you just try a simple npm start and repeat it all runs fine.

One thing to note here is the /request/hook URL works fine in both native/docker so I guess I'm wondering what x-ray does to the stream internally to just close in the middle.

Part of the problem is that debugging this with docker + microcule is a bit tricky and since I suspect that @Marak know a thing or two about hosting hooks inside docker I decided it could be worth filing an issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions