Neocky / pluGET

📦 Powerful Package manager which updates plugins & server software for minecraft servers
Apache License 2.0
149 stars 27 forks source link

"update" command fails when "separate download path" is set #32

Closed smcclennon closed 3 years ago

smcclennon commented 3 years ago

Describe the bug

The "update all" command paired with a modified "[SFTP] pathtoseperatedownloadpath" config option causes pluGET to fail the first time, and when entering update all again, causes pluGET to crash (traceback below).

This bug seems very similar to #31. ("check" now works with pathtoseparateddownloadpath, but "update" does not).

To Reproduce

Steps to reproduce the behaviour:

  1. Edit config.ini 1a. [SFTP] separatedownloadpath = True 1b. [SFTP] pathtoseperatedownloadpath = /plugins/pluGET
  2. Run ./launcher.sh
  3. Enter the command "update all"
  4. Wait for plugin updates to be checked (successfully)
  5. Agree to plugin updates (enter y)
  6. See error

Expected behavior

Plugin updates should be downloaded into the /plugins/pluGET folder.

Desktop

Additional context

I have made sure that the /plugins/pluGET path does already exist, and the same error persists.

I have not tested setting "[SFTP] separatedownloadpath = False".

Other config options I have set which may be relevant:

PluGET error-free console output (... = console output that was trimmed out)

pluGET >> update all
Selected plugins with available Updates:
Check for updates before updating plugins with: 'check all'
Started checking for updates...
Checking: all
Use 'check all changelog' to get the latest changelog from plugins
│ No. │ Name                           │ Installed V. │ Latest V.    │
...
  [16]  DiscordSRV-Build                 1.22.0         1.23.0
  [24]  Hibernate                        1.02           2.0.0 
  [30]  MyCommand                        5.7.0          v5.7.1
  [35]  Plan                             5.3 build 1284 5.4 build 1330
...
Outdated plugins: [13/51]
Please input 'update all' again!
pluGET >> update all
Selected plugins with available Updates:
... DiscordSRV-Build Hibernate MyCommand Plan-3-build-1284.jar ShulkerRespawner ...
Update these plugins [y/n] ? y
Updating: all
│ No. │ Name                           │ Old V.     │ New V.   │
# ===[CRASHES HERE]===

Full traceback:

Traceback (most recent call last):
  File "~/pluGET/src/./__main__.py", line 16, in <module>
    mainFunction()
  File "~/pluGET/src/./__main__.py", line 14, in mainFunction
    getInput()
  File "~/pluGET/src/handlers/handle_input.py", line 105, in getInput
    handleInput(inputCommand, inputSelectedObject, inputParams)
  File "~/pluGET/src/handlers/handle_input.py", line 87, in handleInput
    getInput()
  File "~/pluGET/src/handlers/handle_input.py", line 105, in getInput
    handleInput(inputCommand, inputSelectedObject, inputParams)
  File "~/pluGET/src/handlers/handle_input.py", line 58, in handleInput
    updateInstalledPackage(inputSelectedObject)
  File "~/pluGET/src/plugin/plugin_updatechecker.py", line 295, in updateInstalledPackage
    pluginAttributes = sftp_validateFileAttributes(connection, pluginFile)
  File "~/pluGET/src/handlers/handle_sftp.py", line 97, in sftp_validateFileAttributes
    pluginSFTPAttribute = sftp.lstat(pluginPath)
  File "/home/username/.local/lib/python3.9/site-packages/pysftp/__init__.py", line 779, in lstat
    return self._sftp.lstat(remotepath)
  File "/home/username/.local/lib/python3.9/site-packages/paramiko/sftp_client.py", line 511, in lstat
    t, msg = self._request(CMD_LSTAT, path)
  File "/home/username/.local/lib/python3.9/site-packages/paramiko/sftp_client.py", line 813, in _request
    return self._read_response(num)
  File "/home/username/.local/lib/python3.9/site-packages/paramiko/sftp_client.py", line 865, in _read_response
    self._convert_status(msg)
  File "/home/username/.local/lib/python3.9/site-packages/paramiko/sftp_client.py", line 894, in _convert_status
    raise IOError(errno.ENOENT, text)
FileNotFoundError: [Errno 2] No Such File
Neocky commented 3 years ago

Hey @smcclennon,

thank you again for your good bug report! I will investigate the issue and will report back.

Neocky commented 3 years ago

Hey @smcclennon,

i just released a new version which fixes your issue! Download it here and you are good to go: v1.6.4

Thanks again for flying with pluGET 🚀