Provide a sane configuration to avoid fetch fail #604

Closed
opened 2025-11-09 09:53:46 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @j1cs on GitHub (Nov 28, 2024).

problem description

Dear Developers,

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com. My instance is not exposed to the internet, and I have configured the cookies properly. However, I still receive a 400 error from the API with the message error.api.fetch.fail.

Could you please provide a recommended configuration (including the proper setup of cookies) to resolve this error for Instagram and X.com? Any guidance or sample configuration would be greatly appreciated.

Additionally, when attempting to create an issue, I noticed the following message:

Discord Community

Ask questions and discuss Cobalt with others at any time. Usually faster responses as more people are there to help.

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support. Could you clarify if there is a support channel available? If not, it might be helpful to update the guidance to reflect the current support options.

Thank you for your assistance.

your instance configuration

service:
  cobalt:
    image: ghcr.io/imputnet/cobalt:10.4.1-47804f4
    init: true
    read_only: true
    restart: unless-stopped
    ports:
      - 9015:9015
    volumes:
      - ./cobalt/cookies.json:/app/cookies.json
    environment:
      - COOKIE_PATH=/app/cookies.json
      - API_URL=http://localhost:9015/
      - API_PORT=9015
Originally created by @j1cs on GitHub (Nov 28, 2024). ### problem description Dear Developers, I am encountering an issue with my self-hosted instance where I consistently receive the error `error.api.fetch.fail` when trying to get content from Instagram and X.com. My instance is not exposed to the internet, and I have configured the cookies properly. However, I still receive a 400 error from the API with the message `error.api.fetch.fail`. Could you please provide a recommended configuration (including the proper setup of cookies) to resolve this error for Instagram and X.com? Any guidance or sample configuration would be greatly appreciated. Additionally, when attempting to create an issue, I noticed the following message: > **Discord Community** > > Ask questions and discuss Cobalt with others at any time. Usually faster responses as more people are there to help. However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support. Could you clarify if there is a support channel available? If not, it might be helpful to update the guidance to reflect the current support options. Thank you for your assistance. ### your instance configuration ```shell service: cobalt: image: ghcr.io/imputnet/cobalt:10.4.1-47804f4 init: true read_only: true restart: unless-stopped ports: - 9015:9015 volumes: - ./cobalt/cookies.json:/app/cookies.json environment: - COOKIE_PATH=/app/cookies.json - API_URL=http://localhost:9015/ - API_PORT=9015 ```
GiteaMirror added the instance hosting help label 2025-11-09 09:53:46 -06:00
Author
Owner

@wukko commented on GitHub (Nov 28, 2024):

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com.

do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work?

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support

read the #hey channel

@wukko commented on GitHub (Nov 28, 2024): > I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com. do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work? > However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support read the #hey channel
Author
Owner

@wukko commented on GitHub (Nov 28, 2024):

also: please don't use a llm to talk to people. it's disrespectful.

@wukko commented on GitHub (Nov 28, 2024): also: please don't use a llm to talk to people. it's disrespectful.
Author
Owner

@j1cs commented on GitHub (Nov 28, 2024):

However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support

read the #hey channel

duh. i'm a moron

also: please don't use a llm to talk to people. it's disrespectful.

i wanted to be very clear. english ain't my native language but ok will never use it again.

Answering your questions:

I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com.

do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work?

1.- pretty much with all links. works only few times.
2.- i didn't try the test. now i'm going to and see.
2.- yes. it shows a message saying that cookies were loaded correctly.

@j1cs commented on GitHub (Nov 28, 2024): > > However, upon joining the Discord server, I couldn't find any channels dedicated to questions or support > > read the #hey channel duh. i'm a moron > also: please don't use a llm to talk to people. it's disrespectful. i wanted to be very clear. english ain't my native language but ok will never use it again. Answering your questions: > > I am encountering an issue with my self-hosted instance where I consistently receive the error error.api.fetch.fail when trying to get content from Instagram and X.com. > > do absolutely all links not work? even those from our tests? does cobalt log a message saying that cookies were loaded? do other services work? > 1.- pretty much with all links. works only few times. 2.- i didn't try the test. now i'm going to and see. 2.- yes. it shows a message saying that cookies were loaded correctly.
Author
Owner

@j1cs commented on GitHub (Nov 28, 2024):

OK this is what i found:
after made a POST

{
  "url": "https://www.instagram.com/p/DCpeVbKSBXR"
}

which ends here: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/instagram.js#L291
with data as undefined and the cookie is being delivered:
image

POST:

{
  "url": "https://x.com/OldInternetFeel/status/1861881374820421849"
}

in the case of x.com ends: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/twitter.js#L118
then here https://github.com/imputnet/cobalt/blob/main/api/src/processing/match.js#L299
this is because cookie isn't being provide the first time and the the status code got 404
image

thank for answering

@j1cs commented on GitHub (Nov 28, 2024): OK this is what i found: after made a POST ``` { "url": "https://www.instagram.com/p/DCpeVbKSBXR" } ``` which ends here: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/instagram.js#L291 with data as undefined and the cookie is being delivered: ![image](https://github.com/user-attachments/assets/c2f19d3e-584f-49cb-8f98-65d10c828956) POST: ``` { "url": "https://x.com/OldInternetFeel/status/1861881374820421849" } ``` in the case of x.com ends: https://github.com/imputnet/cobalt/blob/main/api/src/processing/services/twitter.js#L118 then here https://github.com/imputnet/cobalt/blob/main/api/src/processing/match.js#L299 this is because cookie isn't being provide the first time and the the status code got 404 ![image](https://github.com/user-attachments/assets/a364ccbb-10b5-40cb-b814-fc5d1d217900) thank for answering
Author
Owner

@hextor1 commented on GitHub (Nov 29, 2024):

@j1cs Hello Use proxy it will be solve

@hextor1 commented on GitHub (Nov 29, 2024): @j1cs Hello Use proxy it will be solve
Author
Owner

@j1cs commented on GitHub (Nov 29, 2024):

i just realized that my cookies had changed for some reason. i got the new ones from my browser and now everything seems to work. but i think the twitter part has false positives, some messages get the speed limit. then i should try again using the cookie. i will open PR if you guys find it ok.

@j1cs commented on GitHub (Nov 29, 2024): i just realized that my cookies had changed for some reason. i got the new ones from my browser and now everything seems to work. but i think the twitter part has false positives, some messages get the speed limit. then i should try again using the cookie. i will open PR if you guys find it ok.
Author
Owner

@hextor1 commented on GitHub (Nov 29, 2024):

but i think the twitter part has false positives, some messages get

are you using cookies for youtube?

@hextor1 commented on GitHub (Nov 29, 2024): > but i think the twitter part has false positives, some messages get are you using cookies for youtube?
Sign in to join this conversation.