OpenBazaar-Client icon indicating copy to clipboard operation
OpenBazaar-Client copied to clipboard

Issues when switching between server - Client pulls Rest API port from first server setup

Open astupidmoose opened this issue 9 years ago • 7 comments

Brief Description:

I currently have 3 nodes running on the same server. I am unable to switch between the nodes on my client as 2 of the 3 nodes give a authentication error. Only that node which was initially setup is connectable.

Login response for all 3 nodes is "{"success": true}" in the network tab of the web developer console.

After further testing, it seems that the client logs in successfully, and loads the btc price, notifications and chat messages as well as profile. However then it calls for its images using the API which is where the issues occur. It seems that the server is calling the REST API port of the original node, even when trying to access node 2 or 3. The result of this is the authentication failure and lockout of the store.

Example: Node 1 is on port 12001, Node 2 is on 12000 and Node 3 is on 12032. However even though the servers are setup properly in the servers management screen they are all trying to access the API of Node 1 (port 12001) and ignoring their own ports, which seems to be causing a 401 error.

Operating System (OS and version): Tested on the client for both Windows 8.1 and Ubuntu

OpenBazaar version (shown on About OpenBazaar page in menu): v1.1.5

Reproducible (Always / Almost Always / Sometimes / Rarely / Couldn't Reproduce): Always (Tested on 3 machines, all doing it)

Steps to reproduce:

  1. Setup node 1, connect
  2. Setup node 2, connect
  3. setup node 3, connect
  4. switch between nodes

Observed Behavior: Nodes will become unconnectable when switching

Expected Behavior: Ability to switch nodes without issue

Additional info (links, images, etc go here):

Error in action: https://gyazo.com/c3366a3b776b16b2199164886131c1c6 Login Successful: https://gyazo.com/738ff4872d91592805b491cee69ab47f Correct Port being called: https://gyazo.com/d1a8ff2b7463ba1f742432c62ad7b2d9 Followed by Incorrect port: https://gyazo.com/e6f4f291b0c1ac238d76cd09309189aa

Let me know if you need anything else to debug. The Debug.log shows nothing in it in regards to these attempts.

astupidmoose avatar May 21 '16 16:05 astupidmoose

ill look into it.

rmisio avatar May 23 '16 17:05 rmisio

Thanks so much for the uber-detail description. But, I'm not able to reproduce this. When the app connects to a new a server, it re-starts and I'm not seeing any 401s.

I assumer you're running each node with a completely different set of ports (not just the rest API)? e.g:

node1 ==>

python openbazaard.py start -p 12000 -r 12001 -w 12002 -b 12003

node2 ==>

python openbazaard.py start -p 13000 -r 13001 -w 13002 -b 13003

rmisio avatar Jun 02 '16 18:06 rmisio

This is correct.

Node 1 python openbazaard.py start -a 0.0.0.0 -p 11001 -r 12001 -w 13001 -b 14001

Node 2 python openbazaard.py start -a 0.0.0.0 -p 11002 -r 12002 -w 13002 -b 14002

astupidmoose avatar Jun 02 '16 18:06 astupidmoose

where is getting port 12032 on the 'Correct port being called' screen?

rmisio avatar Jun 02 '16 18:06 rmisio

Sorry, not sure i understand the question

12032 is the rest API port for the instance. This screenshot is in network tab of the developers console. When switching from a working instance to a non-working there are multiple rest API calls, however they are sometimes the old rest API port, and sometimes the new one. As if this info is cached in memory somewhere?

astupidmoose avatar Jun 02 '16 18:06 astupidmoose

Issue is still present in 1.1.6 however has slightly different behavior.

Switching to an affected user shows this "Data could not be loaded for: following": https://gyazo.com/18fc23a9c558fa7f61e6a2066e71e59e

followed by authentications failed. https://gyazo.com/afe6cd9f25fd972f424de64cca50cef6

astupidmoose avatar Jun 07 '16 18:06 astupidmoose

@jjeffryes I'm getting this bug as well. I believe it has something to do with the code that pulls the images from the server as @astupidmoose shows here: https://gyazo.com/e6f4f291b0c1ac238d76cd09309189aa

My belief stems from running three stores on a single machine and having no issues but only because one of them had listings. Now, when a friend tries it on their machine he is also running three stores but two of them have listings and switches to the third with no listings work but between the two with listings don't work.

If your tests so far used nodes with no listings then they would likely pass fine.

Do you want me to set up some stores for you so that you can reproduce this?

dsmurrell avatar Jul 27 '16 22:07 dsmurrell