Closed SaurabhQA closed 6 years ago
I think this is due to an unexpected response from the FTP server. Can you share a dir list response from the server?
Thanks for the reply. Below is the dir list from the server
curl ftp://username:password@server:21/path/ total 905328 -r-xr-xr-x 1 current ird 463509504 Dec 21 11:54 filename9_5_1_0-linux64.bin -rw-r--r-- 1 current ird 64 Dec 21 11:54 filename9_5_1_0-linux64.bin.SHA-256
This change should fix your issue: https://github.com/aequitas/concourse-ftp-resource/commit/a058fc0b4d27581e02158ebe6c588cbd839eefad
A new docker image should be build automatically in a few minutes, please reopen this issue if you still have the problem.
Now I am getting the below error. I see a similar issue raised earlier related to SemVer version. I am planning to change the test_check.py. Hope that is the correct approach to solve the below error.
stderr:
DEBUG:root:command: check
DEBUG:root:input: {'source': {'debug': True, 'regex': '(?P
Next time could you please put output like this inside a codeblock so it's easier to read?
test_check.py
is only to verify functionality of the code, you would have to modify ftp.py
as well to actual make a change to the behaviour. Any PR with a good test is welcome.
I am getting the resource script related error while using the ftp resource type.
yml file contents are as below Below is the content of the pipeline. resource_types:
resources:
Below is the error seen in the concourse UI.
resource script '/opt/resource/check []' failed: exit status 1
stderr: DEBUG:root:command: check DEBUG:root:input: {'version': None, 'source': {'regex': '(?Pfilename(?P[0-9\_]+)-\.bin)', 'uri': 'ftp://username:pass@server:21/path/', 'debug': True}}
DEBUG:root:args: []
INFO:root:connecting to ftp server
INFO:root:logging in
INFO:root:changing to directory /path/
Traceback (most recent call last):
File "/opt/resource/check", line 226, in
print(FTPResource().run(os.path.basename(file), sys.stdin.read(), sys.argv[1:]))
File "/opt/resource/check", line 72, in run
output = self.cmd_check(version=data.get('version', {}))
File "/opt/resource/check", line 123, in cmd_check
versions = self._versions_to_output(self._matching_versions(self.listdir()))
File "/opt/resource/check", line 117, in listdir
return [self.parser.parse_line(d)._st_name for d in dirlist]
File "/opt/resource/check", line 117, in
return [self.parser.parse_line(d)._st_name for d in dirlist]
File "/usr/local/lib/python3.5/site-packages/ftputil/stat.py", line 399, in parse_line
year_or_time, name = self._split_line(line)
File "/usr/local/lib/python3.5/site-packages/ftputil/stat.py", line 372, in _split_line
format(line))
ftputil.error.ParserError: line 'total 905328' can't be parsed
Debugging info: ftputil 3.3.1, Python 3.5.1 (linux)