Deployment stuck at "Create Image" step - No logs, no error

Hello, I’m experiencing an issue while deploying my Telegram bot on Fly.io.

Problem:

The deployment gets stuck at the “Create Image” step and doesn’t proceed. No error is shown in logs, and the process stays in “Pending” indefinitely.

Details:

What I tried:

  • Rebuilding with and without cache
  • Verified Dockerfile and requirements.txt
  • Ensured all files are present
  • BOT_TOKEN secret is available
  • Logs show nothing useful: just “Waiting for logs…”

Question:

What can I do to debug this or fix it? Could this be due to a platform issue or configuration mistake?

Thanks in advance!
Karlibay Bekmuratov

How are you deploying this? Via flyctl launch, flyctl deploy, or the GitHub deploy system?

Please supply the logs you do get.

I’d also delete .env from your repo, I wonder if that might override the BOT_TOKEN secret.

I also could not find a listener in your code. Is there something in the code that is binding to port 8080? Which file specifies this port (not including fly.toml)?

Hello Fly.io Support,

I am deploying a Telegram anti-spam bot using Fly.io and my app starts successfully, but the machine stops a few seconds after startup. I am using flyctl deploy for deployment (not GitHub actions).

Here are the key details:

The .env file was previously in the GitHub repository, but I have since deleted it.

I am using fly secrets set BOT_TOKEN=… for my secret environment variable.

My code now includes an aiohttp web server listening on port 8080 as expected by Fly.io:

app = web.Application()
async def health_check(request):
return web.Response(text=“Bot is running”)
app.router.add_get(“/”, health_check)

site = web.TCPSite(runner, ‘0.0.0.0’, 8080)
await site.start()

The fly.toml includes:

[services]
internal_port = 8080
protocol = “tcp”
[[services.ports]]
port = 80
handlers = [“http”]
[[services.ports]]
port = 443
handlers = [“tls”, “http”]

Despite all that, the machine still shuts down. In the logs, I see messages like:

NameError: имя ‘python’ не определено

It seems that python main.py is being interpreted incorrectly, possibly due to a syntax or command issue. Can you help me resolve this?

Thank you in advance!

If needed, I can provide full logs or a link to the GitHub repo.

пн, 19 мая 2025 г., 07:07 JH via Fly.io <notifications@fly1.discoursemail.com>:

Please consider using Markdown to format your posts here (Python and TOML especially). I assume sending your posts via email won’t let you do that.

Thank you for the suggestion. I will make sure to use proper Markdown formatting (for Python and TOML) in future messages when possible. You’re right, my previous message was sent via email, which doesn’t support Markdown formatting well. I appreciate your guidance.

Best regards,
Karlibay Bekmuratov.

пн, 19 мая 2025 г., 17:19 JH via Fly.io <notifications@fly1.discoursemail.com>:

@karol594 I invite you to fix this one, on this occasion. Next to every post is a pencil icon, and if you click it, you get full editing facilities.

Getting formatting right isn’t just a case of making your posts easier to read. The above formats, like YAML, will not work if their indentation is incorrect. So, readers will not spot this category of error if you hide it.

Hello Fly.io support,

I have deployed a Telegram bot using Fly Machines. The app is called antispamshield-clean, and the machine ID is 9185319f03d28.

  • The machine starts successfully (Machine started message is shown)
  • I have set the secret BOT_TOKEN using the dashboard
  • The environment variable is read correctly in Python using os.getenv(“BOT_TOKEN”)
  • I confirmed the token is valid and the bot is reachable
  • The main.py uses ApplicationBuilder().token(BOT_TOKEN).build() and run_polling()
  • However, the bot does not respond to /start or /help in Telegram, even in private chat

The logs do not show any Python errors, but no indication of the bot actually polling or replying.

Can you please check if there is an issue with Fly Machines not passing the secret or running the entrypoint correctly?

Thank you.

Karlibay Bekmuratov.

пн, 19 мая 2025 г., 21:10 JH via Fly.io <notifications@fly1.discoursemail.com>:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.