My deployed python application fails to ping certain public webpages
santosh-umari
HOBBYOP

a month ago

Description -

My application is supposed to ping public websites on the internet, but I see from railway deployment the pings are failing for certain websites

This webpage is publically accessible - https://www.jaquar.com/en/duoflo-shower-round-shape?Id=10808

But when I do SSH in my docker image, and run the following command -

pipx run serviceping https://www.jaquar.com/en/duoflo-shower-round-shape?Id=10808

it gives me following error -

Traceback (most recent call last):

File "/root/.cache/pipx/8c04cac3f920af2/bin/serviceping", line 6, in <module>

sys.exit(main())

^^^^^^

File "/root/.cache/pipx/8c04cac3f920af2/lib/python3.11/site-packages/serviceping/cli.py", line 96, in main

ping_response = ping(host=hostname, port=port, url=url, https=https, sequence=count_sent, timeout=options.timeout)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.cache/pipx/8c04cac3f920af2/lib/python3.11/site-packages/serviceping/network.py", line 251, in ping

result = scan(host=host, port=port, url=url, https=https, timeout=timeout, max_size=max_size)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/.cache/pipx/8c04cac3f920af2/lib/python3.11/site-packages/serviceping/network.py", line 90, in scan

network_socket = ssl.wrap_socket(network_socket) # nosec

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/ssl.py", line 1482, in wrap_socket

return context.wrap_socket(

^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket

return self.sslsocket_class._create(

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.11/ssl.py", line 1104, in _create

self.do_handshake()

File "/usr/local/lib/python3.11/ssl.py", line 1382, in do_handshake

self._sslobj.do_handshake()

ssl.SSLError: [SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:1016)

Here is another example where it fails to ping -

pipx run serviceping https://www.jswonemsme.com/product-detail/sail-mildsteel-channels-e450br-ismc?source=plp&source_page=PLP

root@0fb960b829bc:/lib# SERVICEPING www.jswonemsme.com:443 (34.117.41.196:443).

TCP socket timeout (1.0 seconds) for seq 0

TCP socket timeout (1.0 seconds) for seq 1

TCP socket timeout (1.0 seconds) for seq 2

TCP socket timeout (1.0 seconds) for seq 3

TCP socket timeout (1.0 seconds) for seq 4

TCP socket timeout (1.0 seconds) for seq 5

TCP socket timeout (1.0 seconds) for seq 6

TCP socket timeout (1.0 seconds) for seq 7

other websites work perfectly

Solved$10 Bounty

Pinned Solution

optimalresource
PRO

a month ago

Maybe, you can go to your settings on the given service. Go to the Static Outbound IP section and enable static IP. Then go to the three dots on the right side of your instance latest deployment and redeploy the service. Then wait for say 15 minutes after redeployment completes, then try it again.

2 Replies

Status changed to Open Railway 27 days ago


optimalresource
PRO

a month ago

Maybe, you can go to your settings on the given service. Go to the Static Outbound IP section and enable static IP. Then go to the three dots on the right side of your instance latest deployment and redeploy the service. Then wait for say 15 minutes after redeployment completes, then try it again.


optimalresource

Maybe, you can go to your settings on the given service. Go to the Static Outbound IP section and enable static IP. Then go to the three dots on the right side of your instance latest deployment and redeploy the service. Then wait for say 15 minutes after redeployment completes, then try it again.

santosh-umari
HOBBYOP

a month ago

Thanks for the response. This worked !


Status changed to Solved brody 26 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...