nadermx / backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.
https://www.backgroundremoverai.com
MIT License
6.69k stars 556 forks source link

Getting Error 400 from the API server. It was working fine yesterday. #108

Closed ksegla closed 10 months ago

ksegla commented 10 months ago

Hi I wrote about the error 500 yesterday and you fixed that. Thanks! It was working perfectly till this morning. Now, it keeps sending me Error 400. I don't think it's on my side since the same requests were working yesterday.

xzitlou commented 10 months ago

Hello, the 400 error sends a response JSON. Could you try printing that JSON and sharing it with us, please?

ksegla commented 10 months ago

Here is what I got from the server response

statusCode: Failed with status code: 400 reasonPhrase: Bad Request
request: POST https://api.backgroundremoverai.com/v1/convert/

stream: {"error": "", "params": {"key": "MYAPIKEY", "file_count": 0}}

Again, the exact same code was working well yesterday (like 12 hours ago)

xzitlou commented 10 months ago

Thanks, let me check

ksegla commented 10 months ago

@xzitlou Using the exact js code provided on the website and printing all the response, I got this:

{
    "statusCode": 400,
    "body": "{\"error\": \"\", \"params\": {\"key\":[MY_API_KEY], \"file_count\": 1}}",
    "headers": {
        "server": "nginx",
        "date": "Mon, 13 Nov 2023 14:44:31 GMT",
        "content-type": "application/json",
        "content-length": "85",
        "connection": "close",
        "x-frame-options": "DENY",
        "vary": "Origin",
        "x-content-type-options": "nosniff",
        "referrer-policy": "same-origin",
        "cross-origin-opener-policy": "same-origin"
    },
    "request": {
        "uri": {
            "protocol": "https:",
            "slashes": true,
            "auth": null,
            "host": "api.backgroundremoverai.com",
            "port": 443,
            "hostname": "api.backgroundremoverai.com",
            "hash": null,
            "search": null,
            "query": null,
            "pathname": "/v1/convert/",
            "path": "/v1/convert/",
            "href": "https://api.backgroundremoverai.com/v1/convert/"
        },
        "method": "post",
        "headers": {
            "Authorization": [MY_API_KEY],
            "Content-Type": "multipart/form-data; boundary=--------------------------[SOME_NUMBERS_I REMOVED_TO_BE_SAFE]",
            "content-length": 244926
        }
    }
}
xzitlou commented 10 months ago

Can you help me with your email address, or please submit the contact form https://www.backgroundremoverai.com/contact/ I will check your account details

xzitlou commented 10 months ago

Thanks, I received your email address; I will come back to you ASAP

xzitlou commented 10 months ago

@ksegla, sorry for the delay. Yesterday we performed a migration that broke the API, but it should be resolved now. We apologize for any inconvenience caused.

ksegla commented 10 months ago

Hi Thanks. It's working again (possibly slightly slower though, not sure).

nadermx commented 10 months ago

The speed depends on the img/video some take a bit longer than others. Either way, thanks