Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup Download Fails #4659

Closed
1 of 4 tasks
Bachomp opened this issue Oct 3, 2022 · 15 comments
Closed
1 of 4 tasks

Backup Download Fails #4659

Bachomp opened this issue Oct 3, 2022 · 15 comments
Assignees
Labels
bug Issue describes a bug done Done but not yet released
Milestone

Comments

@Bachomp
Copy link

Bachomp commented Oct 3, 2022

The problem

Downloading of backups via the web interface results in a 404 error.

Files located on the file system have single quotes around them.

image

Did the issue persist even in safe mode?

Yes, it did persist

If you could not test in safe mode, please state why

No response

Version of OctoPrint

1.8.4

Operating system running OctoPrint

OctoPi 0.18.0

Printer model & used firmware incl. version

Prusa Mk3s

Browser and version of browser, operating system running browser

MacOS 12.6. Vivaldi 5.4.2753.51 (Stable channel) (x86_64)

Checklist of files to include below

  • Systeminfo Bundle (always include!)
  • Contents of the JavaScript browser console (always include in cases of issues with the user interface)
  • Screenshots and/or videos showing the problem (always include in case of issues with the user interface)
  • GCODE file with which to reproduce (always include in case of issues with GCODE analysis or printing behaviour)

Additional information & file uploads

octoprint-systeminfo-20221003113304.zip

@github-actions github-actions bot added the triage This issue needs triage label Oct 3, 2022
@foosel
Copy link
Member

foosel commented Oct 3, 2022

Were those backups created through the web interface, CLI, some third party plugin?

@jneilliii
Copy link
Contributor

based on the name, looks like it might be my backup scheduler plugin and is also creating hidden files similar to #4500

@jneilliii
Copy link
Contributor

@cp2004
Copy link
Member

cp2004 commented Oct 3, 2022

I suspect that's an issue with the new backup name validation (1.8.3 I think?), because it has a custom name?

def _match_backup_filename(cls, path, settings):

@Bachomp
Copy link
Author

Bachomp commented Oct 3, 2022

Were those backups created through the web interface, CLI, some third party plugin?

Actually, good point Gina, I believe the backup creation is triggered using the third party "Backup Scheduler Version: 0.1.0" on the startup event

@foosel
Copy link
Member

foosel commented Oct 4, 2022

I think @cp2004 found the culprit. In my tightening down of API endpoints to prevent abuse, I didn't think of arbitrary backup names given on CLI or by third party plugins. So I guess that change needs rolling back or at least some nerfing.

@Bachomp just to make sure, downloading a backup created through the regular Backup plugin works? If so it's indeed just the filename sanity check.

@foosel
Copy link
Member

foosel commented Oct 4, 2022

not sure how, but am I using the backup helpers incorrectly?

https://github.com/jneilliii/OctoPrint-BackupScheduler/blob/1081d996e3536c622e7eb6e665684c91b8dfa557/octoprint_backupscheduler/__init__.py#L158-L161

I don't think you are, but something is still going on given stuff is single quoted. Or is that just what ls does here in case of spaces in the filename? 🤔

@Bachomp
Copy link
Author

Bachomp commented Oct 4, 2022

Just did a test and the manual native backup and download is working. The issue only appears to be related to @jneilliii plugin.

@foosel foosel added bug Issue describes a bug and removed triage This issue needs triage labels Oct 4, 2022
@foosel foosel added this to the 1.8.x milestone Oct 4, 2022
@foosel
Copy link
Member

foosel commented Oct 4, 2022

Or is that just what ls does here in case of spaces in the filename? 🤔

Indeed it is:

$ ls
'file with spaces.txt'   file_without_spaces.txt

So, nerfing the name check it is, since third party plugins and the CLI can choose arbitrary names.

@foosel
Copy link
Member

foosel commented Oct 5, 2022

Fix ready for 1.8.5

@foosel foosel added the done Done but not yet released label Oct 5, 2022
@foosel foosel closed this as completed in b4d0ed3 Oct 17, 2022
@thisiskeithb
Copy link

After updating to 1.8.5 on a few Pis here, clicking download on existing backups through the OctoPrint web gui now fail with a 404 error (previously worked in 1.8.4). I can see/still download the zips through SFTP from /home/pi/.octoprint/data/backup/, so the files are there:

------------------------------------------------------------------------------
OctoPrint version : 1.8.5
OctoPi version    : 0.18.0
------------------------------------------------------------------------------

pi@testpi:~ $ ls /home/pi/.octoprint/data/backup
Test-Pi-backup-20221017-105634.zip

I created new backups under 1.8.5 and those also fail to download with a 404 error, so this seems like it affects all backups.

@jneilliii
Copy link
Contributor

I have confirmed the same issue on one of my instances.

@jneilliii jneilliii reopened this Oct 17, 2022
@github-actions github-actions bot removed the done Done but not yet released label Oct 17, 2022
@jneilliii jneilliii added the triage This issue needs triage label Oct 17, 2022
@foosel
Copy link
Member

foosel commented Oct 17, 2022

Confirmed, hopefully now really fixed. If anyone could test staging/bugfix until tomorrow, that would be lovely, I don't trust my own eyes anymore right now. 1.8.6 planned first thing in the CEST morning.

@foosel foosel added needs testing Testing from the community is needed done Done but not yet released and removed triage This issue needs triage labels Oct 17, 2022
@jneilliii
Copy link
Contributor

I can confirm that staging/bugfix does allow me to download backups again.

@foosel foosel removed the needs testing Testing from the community is needed label Oct 18, 2022
@foosel foosel closed this as completed in ac6240a Oct 18, 2022
@Bachomp
Copy link
Author

Bachomp commented Oct 18, 2022

Also confirmed downloads are now working again

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue describes a bug done Done but not yet released
Projects
Status: Done
Development

No branches or pull requests

5 participants