Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

HTTP Gateway fails to load sharded website #1963

Closed
lidel opened this issue Mar 26, 2019 · 4 comments · Fixed by ipfs/js-ipfs-http-response#19
Closed

HTTP Gateway fails to load sharded website #1963

lidel opened this issue Mar 26, 2019 · 4 comments · Fixed by ipfs/js-ipfs-http-response#19
Assignees
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/in-progress In progress

Comments

@lidel
Copy link
Member

lidel commented Mar 26, 2019

Part of an effort to run embedded js-ipfs in Brave 🦁 ipfs/ipfs-companion#716

  • Version: js-ipfs version: 0.35.0-rc.3
  • Platform: Linux, Node.js v10.15.0
  • Subsystem: HTTP Gateway

Type: Feature/Bug?

Severity: High?

Description:

Tried to open wikipedia mirror from js-ipfs's Gateway and got sad. Not sure if a bug or just not implemented?

Steps to reproduce the error:

  1. Open http://127.0.0.1:9090/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/
  2. Get sad
$ curl http://127.0.0.1:9090/ipfs/bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/
{"statusCode":404,"error":"Not Found","message":"no link named \"wiki\" under bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq"}
@alanshaw
Copy link
Member

@achingbrain can you help with this one?

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up labels Mar 29, 2019
@achingbrain
Copy link
Member

I think this error comes from this line in js-ipfs-http-response which is called by the gateway.

It looks like it does a bunch of DAG manipulations assuming it's dealing with a straight dag-pb node. That is I'm not sure this has ever worked with sharded directories.

It should probably use the unixfs-exporter instead as that can handle more types of node.

@achingbrain
Copy link
Member

Actually I've just put a fix together for this, I'll submit a PR. We should be able to remove js-ipfs-http-response as a dep too so hooray for ever so slightly smaller bundle sizes.

@lidel
Copy link
Member Author

lidel commented Mar 29, 2019

@achingbrain Thank you for looking into this.

I think js-ipfs-http-response continues to be responsible for generating HTML of directory listings, and it is also a dep of service-worker-gateway – is it possible to fix it upstream, or is refactor too big to be worth it?

That is I'm not sure this has ever worked with sharded directories.

Ok, I've found this TODO in libdweb branch of Companion, so it seems it never worked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/in-progress In progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants