The Movie Database Support

Hi TMDB,

I'm having some issues with connecting my Discord bot to the TMDB API. It connects and runs as intended whenever I'm running the bot locally but I'm trying to host it on Cybrancee and API connection keeps getting refused and coming back with the following error:

code: 'ECONNREFUSED',

errors: [ Error: connect ECONNREFUSED ::1:443

    at createConnectionError (node:net:1634:14)

    at afterConnectMultiple (node:net:1664:40) {

  errno: -111,

  code: 'ECONNREFUSED',

  syscall: 'connect',

  address: '::1',

  port: 443

I raised a query with Cybrancee but was told that this is a connection problem at your end. Any idea why the connection is being blocked? Thanks!

3 replies (on page 1 of 1)

Jump to last post

Hi @pepper_head, the address "::1" is the ipv6 local loopback address. Somewhere in your code you are trying to connect to the local system for some reason, and it is not configured properly on the hosting service you are using.

Hi robbie3999, thanks for getting back to me.

This is the code that is connecting to the API:

try {

    const response = await axios.get('https://api.themoviedb.org/3/authentication', {

        headers: {

            'accept': 'application/json',

            'Authorization': `Bearer ${process.env.TMDB_API_TOKEN}`

        }

    });



    console.log('API connection successful');

    console.log('TMDB API response:', response.data);



} catch (error) {

    console.error('API connection failed:', error);

}

});

I haven't configured anything in the code to specifically connect to the local system.

Well, I'm just reading what the error information shows, its clearly calling out an address and port. Keep in mind that the error may not be coming from the try/catch code you listed. Perhaps someone else will come along and have more ideas.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Đăng nhập