voz

"Invalid request" when opening web GUI & APIs

Recommended Posts

Hi, I use an evaluation API key for building an application around the sync API. Till few days ago everything worked well and I was able to call the APIs successfully.

Now when I start the Sync on one of my machines with a config file (please see below), I can not open http://127.0.0.1:888, it just shows "Invalid request". I get the same response on all API calls on that machine. This behaviour is the same across browsers: Chrome/Safari/Firefox.

Interestingly, on other development machines everything works well and the APIs work as expected. So the evaluation key seems to be valid (it should still be valid for another 3 month). 

We run:

  • Mac OS 10.11.3
  • Sync 2.3.1 (259)

 

Any idea what could be the reason? Could it be related to the fact that I am using an evaluation key or it is something else?

My config file as it is:
 

{
    "agree_to_EULA": "yes",
    "device_name": "xyz-server",
    // path to folder where Sync will store its internal data,
    // folder must exist on disk
    "storage_path" : "/xyz/system/btsync/metadata",
    // run Sync in GUI mode
    "use_gui" : true,

    "webui" : {
        // IP address and port to access HTTP API
        "listen" : "127.0.0.1:8888",
        // login and password for HTTP basic authentication
        // authentication is optional, but it's recommended to use some
        // secret values unique for each Sync installation
        "login" : "abc",
        "password" : "def",
        // replace xxx with API key received from BitTorrent
        "api_key" : "MY-API-KEY"
    }
}

 

Share this post


Link to post
Share on other sites

@acp Try cleaning up the cookies on affected browser and see if it helps. Also, I guess that every time you start working with API you call for a new token, right?

Share this post


Link to post
Share on other sites

@RomanZ I've tried cleaning the cookies and also the anonymous mode of Chrome, the result is the same. 

Yes, I make a call for a token every time.

I've also tried removing and installing again the Sync and specifying a clean metadata folder, it did not help.

Share this post


Link to post
Share on other sites

@acp When you run your Sync, try adding one more switch: --nodaemon. This will force Sync to run in existing console and dump some information about what happens. Try to do that and see if there is anything specific about API mode. You can also PM me the log so i'll take a look what happens.

Share this post


Link to post
Share on other sites

@RomanZ thanks for trying to help

I've put --nodaemon and no logs appear, the same as without it.

I run /Applications/BitTorrent\ Sync.app/Contents/MacOS/BitTorrent\ Sync --nodaemon --config /xyz/system/btsync/btsync_config.json from my terminal, it launches the Sync, but there is no output in the terminal.

Share this post


Link to post
Share on other sites

@acp Oh, right. The --nodaemon is only working on Linux, sorry for that. Well, then just send me sync.log from your storage folder. Send it via PM or via our support form (just mention it goes for me and this forum topic).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now