Answer the question
In order to leave comments, you need to log in
How to solve the problem with deploying to Travis-CI via FTP [TimeoutError: Connection timed out]?
With Travis-CI, I want to implement the following scenario:
language: python
branches:
only:
- project/feature/CI&CD
python:
- "3.7"
env:
- DJANGO_VERSION=2.2.6
install:
- pip install -q Django==$DJANGO_VERSION
- sh install.sh
script: sh test.sh
after_success:
- sh build.sh
- python deploy.py
import os
import ftplib
ftp = ftplib.FTP()
print(ftp.connect(HOST, PORT))
print(ftp.login(os.environ['FTP_USER'], os.environ['FTP_PASSWORD']))
if 'mainService-test' not in ftp.nlst():
ftp.mkd('mainService-test')
220 Microsoft FTP Service
230 User logged in.
Traceback (most recent call last):
File "deploy.py", line 151, in <module>
if 'mainService-test' not in ftp.nlst():
File "/opt/python/3.7.1/lib/python3.7/ftplib.py", line 559, in nlst
self.retrlines(cmd, files.append)
File "/opt/python/3.7.1/lib/python3.7/ftplib.py", line 468, in retrlines
with self.transfercmd(cmd) as conn, \
File "/opt/python/3.7.1/lib/python3.7/ftplib.py", line 399, in transfercmd
return self.ntransfercmd(cmd, rest)[0]
File "/opt/python/3.7.1/lib/python3.7/ftplib.py", line 361, in ntransfercmd
source_address=self.source_address)
File "/opt/python/3.7.1/lib/python3.7/socket.py", line 727, in create_connection
raise err
File "/opt/python/3.7.1/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
Answer the question
In order to leave comments, you need to log in
When I run the same script on my machine, everything works!
Those. there are no connection problems. The error occurs only on commands that require any data from the server.
When I run the same script on my machine, everything works!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question