red-hat-storage / noobaa-sa-ci

CI for noobaa standalone product
MIT License
0 stars 4 forks source link

Attempts to download the tls.crt from the NSFS server are failing due to permission issues #27

Closed sagihirshfeld closed 1 month ago

sagihirshfeld commented 5 months ago

An example stacktrace:

___________________________________________________ ERROR at setup of TestS3ObjectOperations.test_expected_put_and_get_failures ____________________________________________________

s3_client_factory_class = <function s3_client_factory_implementation.<locals>.create_s3client at 0x107f87e20>

    @pytest.fixture(scope="class")
    def c_scope_s3client(s3_client_factory_class):
        """
        Create an S3Client using the credentials of a new account - class scoped.

        Returns:
            S3Client: An S3Client instance.

        """
>       return s3_client_factory_class()

tests/conftest.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:186: in create_s3client
    setup_nsfs_tls_cert(config_root)
utility/nsfs_server_utils.py:186: in setup_nsfs_tls_cert
    conn.download_file(
../Documents/repos/common-ci-utils/common_ci_utils/connection.py:149: in download_file
    sftp.get(remotepath, localpath)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:840: in get
    size = self.getfo(
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:795: in getfo
    file_size = self.stat(remotepath).st_size
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:493: in stat
    t, msg = self._request(CMD_STAT, path)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:857: in _request
    return self._read_response(num)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:909: in _read_response
    self._convert_status(msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <paramiko.sftp_client.SFTPClient object at 0x1100f7860>, msg = paramiko.Message(b'\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x11Permission denied\x00\x00\x00\x00')

    def _convert_status(self, msg):
        """
        Raises EOFError or IOError on error status; otherwise does nothing.
        """
        code = msg.get_int()
        text = msg.get_text()
        if code == SFTP_OK:
            return
        elif code == SFTP_EOF:
            raise EOFError(text)
        elif code == SFTP_NO_SUCH_FILE:
            # clever idea from john a. meinel: map the error codes to errno
            raise IOError(errno.ENOENT, text)
        elif code == SFTP_PERMISSION_DENIED:
>           raise IOError(errno.EACCES, text)
E           PermissionError: [Errno 13] Permission denied

venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:940: PermissionError
_______________________________________________________ ERROR at setup of TestS3ObjectOperations.test_expected_copy_failures _______________________________________________________

s3_client_factory_class = <function s3_client_factory_implementation.<locals>.create_s3client at 0x107f87e20>

    @pytest.fixture(scope="class")
    def c_scope_s3client(s3_client_factory_class):
        """
        Create an S3Client using the credentials of a new account - class scoped.

        Returns:
            S3Client: An S3Client instance.

        """
>       return s3_client_factory_class()

tests/conftest.py:226: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/conftest.py:186: in create_s3client
    setup_nsfs_tls_cert(config_root)
utility/nsfs_server_utils.py:186: in setup_nsfs_tls_cert
    conn.download_file(
../Documents/repos/common-ci-utils/common_ci_utils/connection.py:149: in download_file
    sftp.get(remotepath, localpath)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:840: in get
    size = self.getfo(
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:795: in getfo
    file_size = self.stat(remotepath).st_size
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:493: in stat
    t, msg = self._request(CMD_STAT, path)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:857: in _request
    return self._read_response(num)
venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:909: in _read_response
    self._convert_status(msg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <paramiko.sftp_client.SFTPClient object at 0x1100f7860>, msg = paramiko.Message(b'\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00\x11Permission denied\x00\x00\x00\x00')

    def _convert_status(self, msg):
        """
        Raises EOFError or IOError on error status; otherwise does nothing.
        """
        code = msg.get_int()
        text = msg.get_text()
        if code == SFTP_OK:
            return
        elif code == SFTP_EOF:
            raise EOFError(text)
        elif code == SFTP_NO_SUCH_FILE:
            # clever idea from john a. meinel: map the error codes to errno
            raise IOError(errno.ENOENT, text)
        elif code == SFTP_PERMISSION_DENIED:
>           raise IOError(errno.EACCES, text)
E           PermissionError: [Errno 13] Permission denied

venv2/lib/python3.12/site-packages/paramiko/sftp_client.py:940: PermissionError
sagihirshfeld commented 4 months ago

I forgot to push the part that fixes this to https://github.com/red-hat-storage/noobaa-sa-ci/pull/26 - reopening this issue