Graphite and Afari fail to load when using Heroku Gaia Hub

Hi there

I set up a Gaia hub on Heroku by following the link at https://github.com/blockstack/gaia, and could successfully use it for the todo list application

Note:

  • In order to set the Gaia hub, I changed the URL for Gaia hub connection in the Blockstack browser/settings to my Heroku URL
  • I then logged in to the todolist and added a few items
  • I connected to the S3 bucket of Gaia using AWS CLI, and could check that data had been written to my bucket.

Afari or Graphite however fail to load:

  • For Afari, a blank page appear after logging in
  • For Graphite, I can log in, and the home page is displayed, but the application hangs when trying to create a new document

Note: Some data were written on the S3 bucket for both applications:

Ya-L-2:~ yalb$ aws s3 ls s3://bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01/17FmSYNup17YdFbsUK6BfA7edwgNfv9DXJ/
2018-09-27 11:35:41 296 blocktweet_userInfo.json
Ya-L-2:~ yalb$ aws s3 ls s3://bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01/16qcb11Anf6o3x9jSKgjCgRMRmQ1UeR6H7/
PRE /
2018-09-27 09:51:20 8518 documentscollection.json
2018-09-27 11:34:17 68 key.json

So both applications are able to access and write to the S3 bucket.

Any idea why this could happen?

I tested on Chrome and Firefox on a Mac OS. Both Afari and Graphite work fine is using the default Gaia hub.

Thanks!

Hey @yannael_leborgne.id,

Sorry to hear that! Do you see anything in the JS console when trying to use Afari or Graphite?

@jude

Thanks for your quick answer

For Graphite, if I use the default Gaia hub (which resolves to “https://app.graphitedocs.com”: “https://gaia.blockstack.org/hub/16qcb11Anf6o3x9jSKgjCgRMRmQ1UeR6H7/” in my profile.json

I get the following result in the console:

For Graphite landing page: https://gist.github.com/Yannael/89c4423b643a4f399aa4d8d19aeb07ad
For the documents page : https://gist.github.com/Yannael/26b14b7cb0a646b6652933168d2e36b7

Despite the errors in the console, I can create and edit documents.

If I use my Heroku Gaia hub (which resolves to “https://app.graphitedocs.com”: “bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com16qcb11Anf6o3x9jSKgjCgRMRmQ1UeR6H7/” in profiles.json)

Iget the following output

For the landing page: https://gist.github.com/Yannael/74cc046474366d9e416365251f7d6ead
For the documents page: https://gist.github.com/Yannael/3b0bbf0a28c405d476f69e40e70fc1ec

The documents page partially opens, but hangs on the progress bar

Note: I realise that the link to the Gaia hub in the profile.json has a missing ‘/’ after amazon.com : bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com16qcb11Anf6o3x9jSKgjCgRMRmQ1UeR6H7 should be bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com/16qcb11Anf6o3x9jSKgjCgRMRmQ1UeR6H7

Could that be the source of the problem? Any idea why the URL is actually malformed?

In looking at the console errors, those are all expected errors when you haven’t created the files. Every one of the 404s is what a new user sees until they’ve create one of each of the file types (documents, sheets, files, contacts).

And even then, you’ll still get a couple 404s that are specific to files loaded only for Graphite Pro users.

Now if you’re getting 404s and you have created and saved files, that’s 100% tied to the custom gaia hub which @jude will have to help you with.

Hi @yannel_leborgne.id, thank you for taking the time to make these gists!

I think this is part of the problem. This URL needs to be the read URL for your Gaia hub, not Blockstack’s. You can change it by using the CLI, via the gaia_sethub command.

A Gaia hub has distinct read and write endpoints. Your write endpoint was set in the Browser, via the API page. Your profile contains the read endpoint for each app. Somehow, the Browser decided to add gaia.blockstack.org as your read endpoint. It might be an instance of this bug, but I’m not sure

This would be part of it. The read URL in your Gaia hub must end with a /. I think the latest code in the develop branch will do this automatically, but master might not.

I made a video to clarify the issues: https://youtu.be/o_lAKbHRwMk

@jehunter5811

Using the default hub (https://hub.blockstack.org) works fine: I get the 404 error before creating the document, and not after a document has been created.

With my Gaia hub however (https://mygaia.herokuapp.com) , the page for creating a document hangs on the loading progress bar (see videos). I cannot create a document.

@jude

I tested two endpoints: the default hub (https://hub.blockstack.org) and my Gaia hub (https://mygaia.herokuapp.com)

When using my Gaia hub, my profile.json updates accordingly. The Gaia hub URL ends with a trailing ‘/‘. However, there is a missing ‘/‘ inside the URL, see video.

@jude How can the blockstack CLI be installed for having access to the gaia_sethub command?
https://github.com/blockstack/blockstack.js says the CLI is now part of blockstack core. I installed blockstack core using pip, which includes Blockstack cli version 0.18.0.10, but I do not see the gaia_sethub command.

Ah, I see. In your API settings page, does this problem go away if you set your Gaia hub to https://mygaia.herokuapp.com/ instead of https://mygaia.herokuapp.com in the API settings page?

You’ll want this CLI: https://github.com/jcnelson/cli-blockstack (this will replace the Python CLI in the next release).

Ah, I see. In your API settings page, does this problem go away if you set your Gaia hub to https://mygaia.herokuapp.com/ instead of https://mygaia.herokuapp.com in the API settings page?

No, if I use https://mygaia.herokuapp.com/ , see video from 5’15, the Blockstack login hangs.

You’ll want this CLI: https://github.com/jcnelson/cli-blockstack (this will replace the Python CLI in the next release).

Thanks, I’ll test it!

Hey @yannael_leborgne.id,

After watching you change your hub URL in the video and seeing the (invalid) new bucket URL show up in your profile, I noticed this:

$  curl https://mygaia.herokuapp.com/hub_info
{"challenge_text":"[\"gaiahub\",\"2018\",\"1b051c347d9ba8126cfe4a6a87cf264383c0679edf1b30057fde75560c46c9ab\",\"blockstack_storage_please_sign\"]","latest_auth_version":"v1","read_url_prefix":"bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com"}

This is the URL that the Browser uses to obtain the URL prefix for your apps. You see how how read_url_prefix is bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com? It needs to be https://bucketeer-fe7dedb3-902c-4df1-abba-9962a90c3a01.s3.amazonaws.com/. That would explain why there’s no / between your bucket DNS name and the app’s bucket address. You can change this in the Gaia config.json, via the readURL key.