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
File sorting does not update / show correctly when using by Upload date (descending) #2355
Comments
Hi @hoegge, It looks like there is some information missing from your bug report that will be needed in order to solve the problem. Read the Contribution Guidelines which will provide you with a template to fill out here so that your bug report is ready to be investigated (I promise I'll go away then too!). If you did not intend to report a bug but wanted to request a feature or brain storm about some kind of development, please take special note of the title format to use as described in the Contribution Guidelines. Please do not abuse the bug tracker as a support forum - if you have a question or otherwise need some kind of help or support refer to the Mailinglist or the G+ Community instead of here. Also make sure you are at the right place - this is the bug tracker of the official version of OctoPrint, not the Raspberry Pi image OctoPi nor any unbundled third party OctoPrint plugins or unofficial versions. Make sure too that you have read through the Frequently Asked Questions and searched the existing tickets for your problem - try multiple search terms please. I'm marking this one now as needing some more information. Please understand that if you do not provide that information within the next two weeks (until 2018-01-25 10:20 UTC) I'll close this ticket so it doesn't clutter the bug tracker. This is nothing personal, so please just be considerate and help the maintainers solve this problem quickly by following the guidelines linked above. Remember, the less time the devs have to spend running after information on tickets, the more time they have to actually solve problems and add awesome new features. Thank you! Best regards, PS: I'm just an automated script, not a human being, so don't expect any replies from me :) Your ticket is read by humans too, I'm just not one of them. |
Please provide all requested information. Without that information this ticket cannot be looked into and will be closed. Thanks. |
@foosel It "can" be looked at but maybe you won't ;-) Not all the information is relevant (terminal, printer type) for a file upload and display problem or? I have added Octoprint log and Chrome console data. |
It can be looked at if it's the only ticket. It isn't, and running after information simply doesn't scale from a certain point, sorry. By providing all requested information you make sure your problem can be tackled in a timely manner, without endless round trips to request additional information. Isn't that worth the minimum overhead of collecting some logs? |
FYI... I have seen this problem when I manually (via SCP) created a folder in .octoprint/uploads and moved some of the files from .octoprint/uploads into the new folder. After doing that, new files uploaded did not sort correctly. I suspect it has something to do with the .metadata.yaml file being out-of-sync with the folder content after the manual file/folder changes. Deleting .metadata.yaml and letting it be regenerated fixed the problem for me. |
What information is missing? Would be smart if the automated mail said what was missing, I can't see what. Octoprint does often not sort correctly by time and I now have the same problem on a new Octopi/Octoprint, so probably not a one off. |
No information is missing since the OP added what was missing (logs and js console). I so far have not been able to reproduce this though, so any additional information regarding reproduction steps will be helpful. |
I still cannot reproduce this following the above steps. Also not via external modification of the If anyone happens to run into this and can provide reliable reproduction steps, I'm happy to look into this further, but for now I'm marking it as unreproduced. |
BTW, does the color of the filenames have any influence? Sometimes some are red, sometimes some are green and sometimes black. Could not find the reason in the documentation. |
@hoegge red ones failed to print, green one printed successfully, black ones you did not try to print yet |
Version 1.3.8 |
I still haven't been able to reproduce this myself. Does this also happen in safe mode? |
With a file list that is clear of all but one file, I cannot reproduce it in safe or normal mode. |
@BETLOG anything new on that test? |
@foosel unfortunately not. Not noticing that I had inverted the connector on a piezo pcb has progressively fried two of my 3 arduinos regulators. So my printer has been completely inactive since our last posts. I was however not able to duplicate the issue even when attempting to do so. |
@BETLOG sorry to hear about the fried electronics :/ But good to know that you haven't been able to reproduce it so far anymore, I was starting to think I was doing something excessively differently than all of you. |
Hahah. Such is the nature of these things :) |
I have similar problem. I set Sorty by upload date, but this setting is then not saved. Is there any trick to make it work? |
The trick is to figure out how to reproduce it, or why it's happening, so foosel can fix it. :) Try deleting a single older file. |
Well, I managed to duplicate this issue a few days ago, but I have no idea how or why. I was just queuing a file and it wasn't at the top of the list. I have left the offending file at the top of the list and deleted a few files under it, but everything I queue ends up in the correct chronological sequence... under a file that is several days old. Very strange. So it therefore it looks like my glib suggestion of "delete a file" should be "delete the out of place/top file". |
@BETLOG - Before deleting anything else (i.e., while the condition exists) try to gather as much information as possible. At very least, SSL in and capture a directory listing (ls -alt) of the uploads folder, and get a copy of the ".metadata.yaml" file. @foosel -- What other data, tests, or logging might be useful? |
[edit] Sorry, i'll break those files up henceforth... |
I have the same problem over and over again, suddenly files that I uploaded some days ago get to the top of my sort by upload date file list: I will also try to figure out what's going on to help reproduce the bug, what I can say:
Maybe printing a file messes with the internal upload date? Or upload time is used over the date for sorting? Another strange thing, when I change the sorting to name and back to upload, the newest file is suddenly at the bottom: After pressing refresh I get the order above. |
This time the file I queued did not go to the top of the list...But rather quite a long way down the list. Also, possibly related: for no apparent reason a print in progress and at about Z=1mm suddenly started gouging the bed with the nozzle. As if the Z nemas had been inverted part way through a print. I've never seen anything like that before. Maybe this and the mis-sorting is a symptom of some kind of sdcard corruption on the pi? I have had some very unusual yet subtle behaviour because of that in the past. Seems unlikely though. For now I'm going to assume it's a separate issue, unrelated to octoprint. OctoPrint-issue2355__.metadata.yaml_2018-05-15--19-11-32.txt |
Since the upload date is basically the creation/modification date as attached to the file on disk (the younger of the two IIRC), the output of |
@foosel - Could the problem be related to how the file gets to the uploads folder? I know you've mentioned in the past not to manually place files in the Uploads folder and not to Samba share the Uploads folder (we should create a Watched Folder and upload to that instead), since bypassing OctoPrint's normal method for getting files into the uploads folder caused some necessary "housekeeping duties" to be skipped. |
@foosel My Octoprint is acting up again: When reloading the page or pressing refresh the list is wrong: When I switch to sort by name and back to sort by date it is correct until i reload or press refresh: And here is the console ouput, the date and timestamps are in the correct order: I uploaded MK3_OG.gcode via REST API from my own Python Gcode Postprocessor, but I am pretty sure I also had this when manually uploading files. Can I give you any more information to get this bug? |
@John-Mc Good idea, but that necessary house keeping doesn't involve the upload date. That's really just taken from the file metadata itself. Whatever Long story short, this greatly confuses me. What might be interesting on top of an output of @luke321 could you provide the above reponse headers and response body? |
@foosel No problem: Response headers:
response body:
The order is still incorrect with MK3_akkus before MK3_OG in the file list: But when I reorder the list by selecting order by name and than order by date I get to correct order, so the data from the response should be correct right? |
Yeah, it should, but now we know it is, which is better than should ;) Ok, so this really smells like some kind of JS side sorting issue. I understand it only happens on refresh for you @luke321. What about the others? @BETLOG, @adrianmihalko, @ScottWell1, @hoegge can you fix it (until the next refresh) by switching to e.g. sort by name, then switching back to sort by upload date? I'm suspecting something being up with the local storage data (where the sorting preference is stored). |
It has been a while since I had the problem but as best I recall.... YES - switching sort to "by name" and then back to "by upload date" resulted in correct order, but after refreshing the "offending older file" was at the top again. The date/time on the file itself was correct, and Octoprint correctly stated the "uploaded:" age of the file in the listing (as in examples posted by others above). New files added (via watched folder) were inserted into the list below the older file; toggling sort order to name then back to descending date fixed it until a refresh or another file was added. |
@foosel No, toggling sort option did not rectify my list. I have attempted that twice, several weeks apart. Neither time had the desired effect. |
@foosel Toggling the sort option did not always fix everything. |
Hm, too bad. If toggling had always fixed it (temporarily) I at least would have had a lead to go on to but now I'm completely in the dark again. It sucks that I can't reproduce this myself, that would make debugging way way easier. I briefly thought that simply no sorting was being done when it breaks, but that's also not it, the order of files in the response body provided by @luke321 doesn't match the display order. |
I just tried Microsoft EDGE and the order is correct. |
I think I just found it. The issue appears to be caused by the comparator function not handling cases deterministically where one of the compared items doesn't have a date defined - as is the case for SD card files or folders. I was just able to replicate the wrong sorting order in a minimal example based on the response data provided by @luke321, and adjusting the comparator function slightly fixed the sorting order. My current guess is that it could get fixed temporarily in some cases since sorting after e.g. name or size would sort the array in place and hence change the order in which parameters were supplied to the comparator function, which could lead to the correct outcome then depending on the data. Very much theoretical right now, based on taking a long hard look at the code and the minimal example, but it at least makes sense! |
Should be solved by the above commit. Already on |
What were you doing?
What did you expect to happen?
Last uploaded file first
What happened instead?
Last uploaded file second.
Trying to resort or change sort order or reload page does not correct it
Did the same happen when running OctoPrint in safe mode?
Have not tried
Version of OctoPrint
Version 1.3.6
Operating System running OctoPrint
OctoPi
Printer model & used firmware incl. version
not relevant
Browser and Version of Browser, Operating System running Browser
Chrome PC latest
Link to octoprint.log
https://www.dropbox.com/s/zsi9of5fmungz9o/octoprint.log?dl=0
Link to contents of terminal tab or serial.log
https://www.dropbox.com/s/uhkn64lil6np5fi/Terminal%20tab.txt?dl=0
Link to contents of Javascript console in the browser
https://www.dropbox.com/s/lo1d123rri9fk35/browser%20console%2010.10.1.26-1515672229697.log?dl=0
Screenshot(s)/video(s) showing the problem:
The text was updated successfully, but these errors were encountered: