dmcallejo / ASFBot

Control your ArchiSteamFarm with Telegram
GNU General Public License v3.0
43 stars 10 forks source link

HTTPConnectionPool(host='asf', port=1242): Max retries exceeded with url: /Api/ASF (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',)) #3

Closed azumukupoe closed 4 years ago

azumukupoe commented 4 years ago

I keep getting the error. I can access localhost:1242/api/asf on my host computer. Is there anything I can try to fix this?

dmcallejo commented 4 years ago

Hi, you need to specify your host via command option --host . In this case, bot.py --host localhost should work.

azumukupoe commented 4 years ago

Could you check my .yml?

version: '3.2'
services:
  asf:
    image: justarchi/archisteamfarm
    container_name: asf
    hostname: asf
    restart: unless-stopped
    environment:
      - ASF_ARGS=--server
      - TZ=Asia/Tokyo
    ports:
      - 1242:1242
    volumes:
      - '.\config:/app/config'
      - '.\logs:/app/logs'
      - '.\plugins:/app/plugins'
  asfbot:
    image: dmcallejo/asfbot
    container_name: asfbot
    hostname: asfbot
    restart: unless-stopped
    command: --host localhost
    environment:
      - TELEGRAM_BOT_TOKEN=token
      - TELEGRAM_USER_ALIAS=alias

HTTPConnectionPool(host='localhost', port=1242): Max retries exceeded with url: /Api/ASF (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',))

dmcallejo commented 4 years ago

Oh, sorry. I thought you were running it standalone without docker.

Change host back to 'asf': command: --host asf

Make sure in your ASF configuration that the IPC server is serving other IPs other than localhost. In my setup, IPC is setup in a file named IPC.config and looks like this:

{
        "Kestrel": {
                "Endpoints": {
                        "IPv4-http": {
                                "Url": "http://0.0.0.0:1242"
                        }
                },
                "PathBase": "/"
        }
}