Persistent Deployment Issue: Old Code Version Remains Active After Pushing Updates

guehaiz12
FREE

2 months ago

Hello Railway Support Team,

I'm experiencing a persistent deployment issue with my Python application connected to my GitHub repository. Despite successfully pushing new commits and triggering new deployments, an old, incorrect version of my bot file continues to run on the server.

Problem Description:

My bot makes an API call to a payment provider . The current code running on the server is sending a malformed request payload, which causes the API to return a 422 Unprocessable Content error

I have corrected the code in my local bot.py file, but after multiple deployments, the server logs prove that the old, broken code is still being executed.

Evidence from Logs:

Here is a log snippet from the running service, showing the incorrect request payload being sent. The success_url and other URLs have invalid semicolons (;) at the end, which are not present in my latest committed code.

INFO - Sending PROVIDER checkout request: {'amount': 10000, 'currency': 'dzd', ... 'success_url': 'https://t.me/mybot?start=topup_success';, 'failure_url': 'https://t.me/mybot?start=topup_failed';, 'webhook_endpoint': 'https://my-app.up.railway.app/provider_webhook';, ...}

ERROR - Payment API request failed for user [USER_ID]: 422 Client Error: Unprocessable Content ERROR - Payment API request failed for user [USER_ID]: 422 Client Error: Unprocessable Content for url: https://pay.provider.net/api/v2/checkouts

Confirmed my local bot file is correct and has been saved.

  • Successfully pushed the corrected code to the main branch on GitHub.

    riggered multiple new deployments on Railway

  • Disconnected and reconnected the GitHub repository to the Railway service.

  • Confirmed that my environment variables in the Railway dashboard are correct and do not contain any syntax errors.

  • Tested the corrected code by running it locally with ngrok, and it works perfectly.

Could you please help me understand why my service is not updating to the latest commit from my GitHub repository? It seems like there might be a caching issue or a problem with the build/deployment process for my service.

Thank you for your help.

$10 Bounty

14 Replies

Railway
BOT

2 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


2 months ago

Hi, sorry to hear you're running into these issues. Could you please try disconnecting and reconnecting the railway github integration at the account level ?

Best,

Nico


Status changed to Awaiting User Response Railway 2 months ago


clashing
HOBBYTop 10% Contributor

2 months ago

Hi there, you can try these steps:

  1. Select the desired service

  2. Open the command palette by pressing Ctrl/Cmd+K

  3. Then type: "deploy", & choose the option "Deploy Latest Commit"

Note: The deploy command will only show up if you have selected a service!

This update thing works for a GitHub repository, as well as a Docker image (although the name does not suggest that). Once you do that, it will fetch the latest image/version, and would auto-create a new instance, and would destroy the already-running one.

Do let me know if that works for you

Attachments


itsrems

Hi, sorry to hear you're running into these issues. Could you please try disconnecting and reconnecting the railway github integration at the account level ?Best,Nico

guehaiz12
FREE

2 months ago

Unfortenetly I tried all of that I even deleted my entire project and built a new one but the semicolon still appears but when I test the webhook locally using ngrok no semicolon gets added and all goes as in the bot code


guehaiz12

Unfortenetly I tried all of that I even deleted my entire project and built a new one but the semicolon still appears but when I test the webhook locally using ngrok no semicolon gets added and all goes as in the bot code

clashing
HOBBYTop 10% Contributor

2 months ago

It it's not a private repo, can you provide the GitHub repo link, and point out the line which is not being updated!!


guehaiz12

Unfortenetly I tried all of that I even deleted my entire project and built a new one but the semicolon still appears but when I test the webhook locally using ngrok no semicolon gets added and all goes as in the bot code

clashing
HOBBYTop 10% Contributor

2 months ago

As you mentioned in your previous response, the code is not picking up the "semicolon" change. Sometimes, the small changes are not picked up by servers. I also experienced the same while using DOCKER images.

So, you can add some console.log here and there, to see whether those changes are being picked up!


clashing

Hi there, you can try these steps:Select the desired serviceOpen the command palette by pressing Ctrl/Cmd+KThen type: "deploy", & choose the option "Deploy Latest Commit"Note: The deploy command will only show up if you have selected a service!This update thing works for a GitHub repository, as well as a Docker image (although the name does not suggest that). Once you do that, it will fetch the latest image/version, and would auto-create a new instance, and would destroy the already-running one. Do let me know if that works for you

guehaiz12
FREE

2 months ago

2025-07-24 17:45:09,284 - main - INFO - Created pending order 6fe9aaf7-b686-40a6-8868-3d823f83743f for user 1130802479 for 2000.0 DA via provider.

2025-07-24 17:45:09,284 - main - INFO - Sending final X Provider checkout request: {'amount': 2000, 'currency': 'dzd', 'provider_pay_fees_allocation': 'customer', 'success_url': 'https://t.me/mybot_bot?start=topup_success';, 'failure_url': 'https://t.me/mybot_bot?start=topup_failed';, 'webhook_endpoint': 'https://myt-production-f089.up.railway.app/provider_webhook';, 'description': 'Top-up for user 1130802479', 'metadata': {'chat_id': '1130802479', 'order_id': '6fe9aaf7-b686-40a6-8868-3d823f83743f'}}

Unfortenately it is still showing the semicolons the thing is when I run it on ngrok locally it all goes well it is from Railway's side that it is adding the semicolons to the Deploy logs


guehaiz12

2025-07-24 17:45:09,284 - main - INFO - Created pending order 6fe9aaf7-b686-40a6-8868-3d823f83743f for user 1130802479 for 2000.0 DA via provider.2025-07-24 17:45:09,284 - main - INFO - Sending final X Provider checkout request: {'amount': 2000, 'currency': 'dzd', 'provider_pay_fees_allocation': 'customer', 'success_url': 'https://t.me/mybot_bot?start=topup_success';, 'failure_url': 'https://t.me/mybot_bot?start=topup_failed';, 'webhook_endpoint': 'https://myt-production-f089.up.railway.app/provider_webhook';, 'description': 'Top-up for user 1130802479', 'metadata': {'chat_id': '1130802479', 'order_id': '6fe9aaf7-b686-40a6-8868-3d823f83743f'}}Unfortenately it is still showing the semicolons the thing is when I run it on ngrok locally it all goes well it is from Railway's side that it is adding the semicolons to the Deploy logs

clashing
HOBBYTop 10% Contributor

2 months ago

As previously requested, if the GitHub repo is public, can you provide its URL and tell me the line that is causing the issue?

Did you try deploying the code to a new branch, and then using it via the settings tab of the service (re-deploying it with the new branch)?


guehaiz12
FREE

2 months ago

Unfortunately, the repo is private I've provided above the logs adding ; even the source code doesn't contain that in the webhook

what do you mean "new branch"


guehaiz12

Unfortunately, the repo is private I've provided above the logs adding ; even the source code doesn't contain that in the webhookwhat do you mean "new branch"

clashing
HOBBYTop 10% Contributor

2 months ago

Great, thanks for letting me know. Yes, I meant that you should deploy the code to a new branch, and then use it in the Railway service for a new deployment (and make sure to change the name of the bot.py file to something else), so that the changes could be picked easily.

I have also experienced the same issue with Docker images, but it's a very simple workaround for those. Whenever I push a change, I increment the tag count for the Docker image (if not provided, everything goes with the 'latest' tag), and that always ensures that the slightest of code will be reflected in the processing.

If you can, do make a Dockerfile to deploy the Python server in your Docker Hub account (you need to have Docker Desktop installed). The following commands will push the changes in a new tag of the image:

docker build -t dockerhub_username/projectName:tag .

docker push dockerhub_username/projectName:tag


clashing
HOBBYTop 10% Contributor

2 months ago

Any update, guehaiz12


clashing

Any update, guehaiz12

guehaiz12
FREE

2 months ago

Unfortunately no success so I had to an alternaive webhook solution rather relying on Railway on payment gateway side


clashing
HOBBYTop 10% Contributor

2 months ago

Oh, that's bad. If none of the methods that I provided in my previous responses worked, it might be an issue related to something else. But still, you are able to solve that on the payment gateway side


guehaiz12
FREE

2 months ago

I'm actually sure it is coming from the Railway logs which adding semicolon string, I'm currently still using Railway it is going incredibly well but on the payment gate webhook connection I had to rely on a third party without the mention of the name