Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

SFTP connection failing when shouldn't be tested #4125

Closed
Tilix4 opened this issue Nov 23, 2022 · 1 comment · Fixed by #4278
Closed

SFTP connection failing when shouldn't be tested #4125

Tilix4 opened this issue Nov 23, 2022 · 1 comment · Fixed by #4278
Assignees
Labels
module: Sitesync type: bug Something isn't working

Comments

@Tilix4
Copy link
Collaborator

Tilix4 commented Nov 23, 2022

Reproduce

  1. Enable Site Sync module, create a SFTP site with wrong credentials and enable it for your production.
  2. Change your local settings to local and studio (not to the sftp site).
  3. Restart Tray, and look to the logs, it tries to connect when it shouldn't because the user settings don't ask for it.

The logs produced make bug hunting more tedious and slows the server to start because of attempts to connect.

Lead

This is caused by is_active in openpype\modules\sync_server\providers\sftp.py which tries to get the connection to test if the sftp is available.

Proposals

  • Add a check of the current user settings, if the sftp site is not selected as remote, then is_active returns False.
  • Don't even register the module if the sftp site is not selected as remote.

[cuID:OP-4490]

@m-u-r-p-h-y
Copy link
Member

looks like the same thing happening to me . . .

*** WRN: >>> { SyncServerThread }: [  Unhandled except. in sync loop, stopping server  ]
===========
'sftp_host'
===========
Traceback (most recent call last):
  File "D:\REPO\OpenPype\openpype\modules\sync_server\sync_server.py", line 290, in sync_loop
    local_site, remote_site = self._working_sites(project_name)
  File "D:\REPO\OpenPype\openpype\modules\sync_server\sync_server.py", line 478, in _working_sites
    configured_sites = _get_configured_sites(self.module, project_name)
  File "D:\REPO\OpenPype\openpype\modules\sync_server\sync_server.py", line 204, in _get_configured_sites
    return _get_configured_sites_from_setting(module, project_name, settings)
  File "D:\REPO\OpenPype\openpype\modules\sync_server\sync_server.py", line 222, in _get_configured_sites_from_setting
    presets=config)
  File "D:\REPO\OpenPype\openpype\modules\sync_server\providers\lib.py", line 51, in get_provider
    site = creator_info[ 0 ](project_name, site_name, tree, presets)
  File "D:\REPO\OpenPype\openpype\modules\sync_server\providers\sftp.py", line 52, in __init__
    self.sftp_host = presets[ "sftp_host" ]
KeyERROR: 'sftp_host'
  - { SyncServerThread }: [  Finished awaiting cancelled tasks, results: []...  ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module: Sitesync type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants