Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

API calls in testnet returning blank dataset(s) #504

Open
kumrzz opened this issue Nov 15, 2016 · 2 comments
Open

API calls in testnet returning blank dataset(s) #504

kumrzz opened this issue Nov 15, 2016 · 2 comments
Assignees

Comments

@kumrzz
Copy link

kumrzz commented Nov 15, 2016

Brief Description: API calls in testnet returning blank dataset(s)

Operating System (OS and version): Windows 10
OpenBazaar version: SERVER_VERSION = "0.2.3",PROTOCOL_VERSION = 2
Hardware: Surface Pro 3 @ virtualenv

Reproducible (Always):
Steps to reproduce:

  1. update username and password as in below API call, into ob.cfg
  2. python openbazaard.py start -ta 0.0.0.0
  3. curl --data "username=ktest&password=password123" --dump-header headers.txt http://localhost:18469/api/v1/login
  4. curl --cookie headers.txt http://localhost:18469/api/v1/profile

Observed Behavior:
API response: {}

Expected Behavior:
API response(similar to prod): { "profile": { "social_accounts": {}, "moderation_fee": 0.0, "moderator": false, "nsfw": false, "vendor": false, "guid": "5b0de6ec7df9a1ddd44d675f0a2bd8ee0b96497e", "background_color": 11711154, "secondary_color": 15132390, "location": "UNITED_KINGDOM", "short_description": "", "primary_color": 16777215, "email": "", "website": "", "handle": "", "text_color": 0, "last_modified": 1475576391, "public_key": "b44675355c4de653f8b69df289f645ff1af0911d3e0ff679875eb72d46154781", "about": "", "name": "kumR", "header_hash": "44f2e2b03e17326e0617bde347849952ff0725c9", "pgp_key": "", "avatar_hash": "5417644628cbb62e872a910e6e5af32fdb08145e" } }

Additional info:
reproduction in prod:
2. python openbazaard.py start -a 0.0.0.0
3. curl --data "username=ktest&password=password123" --dump-header headers.txt http://localhost:18469/api/v1/login
4. curl --cookie headers.txt http://localhost:18469/api/v1/profile

@kumrzz kumrzz changed the title Brief Description: API calls in testnet returning blank dataset(s) API calls in testnet returning blank dataset(s) Nov 16, 2016
@hoffmabc
Copy link
Member

Are you sending a GUID to the call or no? I'm assuming from your text that's a no so that means you must be getting into this path:

else:
            p = Profile(self.db).get()
            if not p.HasField("guid_key"):
                request.write(json.dumps({}))
                request.finish()
            else:
                temp_handle = self.db.profile.get_temp_handle()
                parse_profile(p, None if temp_handle == "" else temp_handle)

First step would be to check in your OB-Mainnet.db to see if you have a guid key in the keys table. If you do then maybe there's something wrong retrieving your Profile from the db.

@kumrzz
Copy link
Author

kumrzz commented Nov 24, 2016

soz for the late reply ...
No, not sending the GUID: to reiterate, my API call was:
http://localhost:18469/api/v1/profile
I specified 'testnet' in the issue subject and also implied as such in my OB kickoff command:
python openbazaard.py start -ta 0.0.0.0
so am I really looking at OB-Mainnet.db or OB-Testnet.db ?
I checked both, and yes both contain guid and bitcoin (privkey and pubkey) in table: keys.
'something wrong retrieving your Profile from the db': any further clues please?
So you don't think OB is simply confused by the existence of two (mainnet and testnet) dbs ?

Reckon I should just get rid of all traces of OB and reinstall? If so, which windows folders would you recommend looking at especially to make sure none of the old install remnants have persisted?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants