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

[Bug]: Search results broken when requesting to load more results #35558

Closed
6 of 9 tasks
ostasevych opened this issue Dec 2, 2022 · 43 comments · Fixed by #38303
Closed
6 of 9 tasks

[Bug]: Search results broken when requesting to load more results #35558

ostasevych opened this issue Dec 2, 2022 · 43 comments · Fixed by #38303

Comments

@ostasevych
Copy link

ostasevych commented Dec 2, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

When I try to click on the button link "Load more results" there are no any other results shown but the content of the search window in reset. This bug appeared after upgrading from 24.x to 25.x.

image

image

Steps to reproduce

  1. Click on the search icon.
  2. Enter the text for the search.
  3. See the results.
  4. Click the link "Load more results".
  5. Observe that the search window is empty.

Expected behavior

The list of files searched additionally should be shown.

Installation method

Community Manual installation with Archive

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xx.local",
            "192.168.xxx.232",
            "192.168.yyy.100",
            "127.0.1.1"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.1.1",
        "overwrite.cli.url": "https:\/\/xx.local\/",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "UA",
        "maintenance": false,
        "enable_previews": true,
        "preview_max_x": 350,
        "preview_max_y": 350,
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "app_install_overwrite": [
            "documentserver_community",
            "twofactor_admin",
            "files_trackdownloads",
            "twofactor_webauthn",
            "files_fulltextsearch",
            "fulltextsearch_elasticsearch",
            "fulltextsearch",
            "group_default_quota"
        ],
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 3,
        "allow_local_remote_servers": true,
        "activity_use_cached_mountpoints": true,
        "trashbin_retention_obligation": "auto",
        "onlyoffice": {
            "verify_peer_off": true,
            "jwt_secret": "secret",
            "jwt_header": "AuthorizationJwt"
        },
        "enabledPreviewProviders": [
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\Imaginary"
        ],
        "preview_imaginary_url": "http:\/\/localhost:9000"
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - calendar: 4.1.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.0.1
  - dav: 1.24.0
  - encryption: 2.13.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_downloadactivity: 1.15.0
  - files_fulltextsearch: 24.0.1
  - files_lock: 24.0.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.14.0
  - fulltextsearch: 24.0.0
  - fulltextsearch_elasticsearch: 24.0.1
  - group_everyone: 0.1.11
  - groupfolders: 13.1.0
  - holiday_calendars: 0.2.1
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - notes: 4.6.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - onlyoffice: 7.6.8
  - password_policy: 1.15.0
  - previewgenerator: 5.1.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - quota_warning: 1.15.0
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - tasks: 0.14.5
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_admin: 0.2.1
  - twofactor_backupcodes: 1.14.0
  - twofactor_email: 2.7.1
  - twofactor_gateway: 0.20.0
  - twofactor_nextcloud_notification: 3.5.0
  - twofactor_totp: 7.0.0
  - twofactor_webauthn: 1.0.0
  - updatenotification: 1.15.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - bruteforcesettings: 2.5.0
  - circles: 24.0.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - duplicatefinder: 0.0.15
  - extract: 1.3.5
  - federation: 1.14.0
  - files_external
  - files_trackdownloads: 1.11.0
  - group_default_quota: 0.1.4
  - maps: 0.2.1
  - nextcloud_announcements: 1.13.0
  - photos: 1.6.0
  - recommendations: 1.3.0
  - related_resources: 1.0.3
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - suspicious_login
  - systemtags: 1.14.0
  - user_ldap
  - user_status: 1.4.0
  - weather_status: 1.4.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

@ostasevych ostasevych added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 2, 2022
@szaimen
Copy link
Contributor

szaimen commented Dec 2, 2022

Hi, please try again eith 25.0.2

@XueSheng-GIT
Copy link

I've the same issue on 25.0.2rc2 but only if Files is active/loaded and for the first search... after the first failed attempt (empty search after trying to load more search results), it does seem to work. Issue reappears if files is reloaded.
Does this make sense?

@ostasevych
Copy link
Author

ostasevych commented Dec 3, 2022

I've the same issue on 25.0.2rc2 but only if Files is active/loaded and for the first search... after the first failed attempt (empty search after trying to load more search results), it does seem to work. Issue reappears if files is reloaded. Does this make sense?

Eh, cannot understand what you mean under 'files is reloaded'. I tried to repeat searching the exact text and it appeared again.

I am on the stable branch, that's why 25.0.2 is not for me now...

@XueSheng-GIT
Copy link

Eh, cannot understand what you mean under 'files is reloaded'.

For me the issue only appears if the files app is loaded/active. 'files is reloaded' means that I klick again on the files app icon or that I reload the whole webpage.

@ostasevych
Copy link
Author

Eh, cannot understand what you mean under 'files is reloaded'.

For me the issue only appears if the files app is loaded/active. 'files is reloaded' means that I klick again on the files app icon or that I reload the whole webpage.

I may click on the Search icon independently where I am in the webUI. The situation doesn't change - so, when I try to click on Load more I am getting an empty window with no results.

Has anybody succeeded to overcome the issue?

@pjft
Copy link
Contributor

pjft commented Dec 8, 2022

Same error here. 25.0.2.
The only thing that doesn't seem to be mentioned is an error in Chrome Developer Tools when we press "Load more results".
This makes search useless.

vue.runtime.esm.js:3019 
i {message: 'canceled', name: 'CanceledError', code: 'ERR_CANCELED'}
code
: 
"ERR_CANCELED"
message
: 
"canceled"
name
: 
"CanceledError"
[[Prototype]]
: 
i
constructor
: 
ƒ i(e)
__CANCEL__
: 
true
[[Prototype]]
: 
Error

@pjft
Copy link
Contributor

pjft commented Dec 8, 2022

For what it's worth, this didn't seem to happen on 24 I believe. Also, I tried to troubleshoot this, and restore previous core-common.js and core-common.js.map files until commit bfb5295 but it still failed, so I'm starting to wonder if it is server or client-side.

Still, since the "load more results" works on the iOS mobile app, it might be on the client-side, and I just can't dig deeper into it.

Happens on Chrome on Mac, and on Chrome on iOS at least.

Hope this helps?

@ostasevych
Copy link
Author

After updating NC to 25.0.2 the behaviour has changed slightly: now when I click on Load more results the search window just disappears.

@pjft
Copy link
Contributor

pjft commented Dec 13, 2022

Correct, that's what happens in the UI when the CANCELED message shows in Developer Tools.

@ostasevych
Copy link
Author

Correct, that's what happens in the UI when the CANCELED message shows in Developer Tools.

Yup. What to do?

@ostasevych
Copy link
Author

ostasevych commented Dec 13, 2022

The only thing what is working is to use search field from the desktop app. But, it doesn't open links from fulltext search (the same mobile app, what is another bug).

@XueSheng-GIT XueSheng-GIT mentioned this issue Dec 21, 2022
9 tasks
@LibertusDio
Copy link

LibertusDio commented Dec 26, 2022

something to do with the Regex perhaps. I've reverted the dist code to this MR and now it works on my server, hope dev have a looks.

The reason for the idiotic approach is I dont know VUE or frontend in general. Hope this help.

My guess is the code at line 472 checking types, since it might not existed on the first click.

@pjft
Copy link
Contributor

pjft commented Dec 26, 2022

Thank you @LibertusDio . Apologies for the dumb question, but how can I apply that specific change on my end? I can find the two core-unified-search.js and core-unified-search.js.map files, but I cannot find the core/src/views/UnifiedSearch.vuefile on my Nextcloud installation. I wonder if it gets compiled and merged into any other file here?

EDIT: actually, it seems that the UnifiedSearch.vue content gets merged into the other two files, but replacing those two files on my end didn't seem to fix it, so I probably did something wrong. I'm reverting the changes for now.

Thanks for digging into this.

@LibertusDio
Copy link

LibertusDio commented Dec 27, 2022

Thank you @LibertusDio . Apologies for the dumb question, but how can I apply that specific change on my end? I can find the two core-unified-search.js and core-unified-search.js.map files, but I cannot find the core/src/views/UnifiedSearch.vuefile on my Nextcloud installation. I wonder if it gets compiled and merged into any other file here?

EDIT: actually, it seems that the UnifiedSearch.vue content gets merged into the other two files, but replacing those two files on my end didn't seem to fix it, so I probably did something wrong. I'm reverting the changes for now.

Thanks for digging into this.

vue file is source code, I just point it out for dev. We run js files on server (dist folder).
Regarding to what I did:

  • replace the 2 js files then restart server ( in my case php-fpm and nginx)
  • clear cache on client machine and force reload page
  • if you are running behind cloudflare or a CDN, give it some time to propagate cache

@mhepplewhite
Copy link

mhepplewhite commented Dec 27, 2022

It's a bug for me also, click "Load more results" always clears the search as if the Search icon has just been pressed.
25.0.1 on Ubuntu, Mariadb, Apache
A fix is needed please.

@pjft
Copy link
Contributor

pjft commented Jan 9, 2023

Just to update that, for some reason, replacing the files and restarting the server didn't seem to do the trick - though I'm perfectly open to me having done something wrong in the process.

It's still a bit surprising that there's so few people talking about this - I'd imagine that a "search" failure would result in more reports. Could it be it's not a widespread thing, but only for the few unlucky ones here, because of whatever setup we have in place?

It could also be that, since the desktop and mobile apps work as intended, then it's not such a high-priority issue?

Would love to hear more about this, or how could we help to solve this. Search isn't a nice to have, it's quite core to the experience.

@LibertusDio
Copy link

@pjft make sure you are using the old commit, not the new one ( core-unified-search.js?v=0244837ad7c50138e262 not core-unified-search.js?v=488d97505daab8b59ace). Sorry if my previous comment is ambiguous.

About the function itself, I dont think they (Nextcloud the company) are not taking it highly:

  • Enterprise users use the real stable channel, so I dont think this will affect them
  • Us free folks use the stable channel get the beta and I would assume most of us does not use load more much or just "nah, I'm gonna just click the folder, I know where it is"

@pjft
Copy link
Contributor

pjft commented Jan 11, 2023

Got it, that makes sense.

Also, I do confirm your fix: commit f0cd60b21bd5d1a0d493dbe222743d3c3040bc98 works as intended.
Commit 08adbbd7ef3f11b7582c4296b6ac4a39ac63b7d0 breaks things.

Thank you.

@pjft
Copy link
Contributor

pjft commented Jan 11, 2023

Thanks. I confirm that

  • Commit f0cd60b works as intended.
  • Commit 08adbbd breaks things. There was a regression here.

I'll be reverting it for now.

Best.

@pjft
Copy link
Contributor

pjft commented Jan 18, 2023

Just to update that it's still broken in today's release of 25.0.3 .

This is not recommended, it's an unsupported setup, it will not benefit from other fixes and might introduce other bugs

If you want to get search back, these are my steps:

Step 1: go to Nextcloud's folder

sudo -s
cd /var/www/html/nextcloud/dist

Backup existing files:

cp core-unified-search.js core-unified-search.js.original
cp core-unified-search.js.map core-unified-search.js.map.original

Get the good files:

wget https://raw.githubusercontent.com/nextcloud/server/f0cd60b21bd5d1a0d493dbe222743d3c3040bc98/dist/core-unified-search.js.map
wget https://raw.githubusercontent.com/nextcloud/server/f0cd60b21bd5d1a0d493dbe222743d3c3040bc98/dist/core-unified-search.js

Overwrite old ones:

cp core-unified-search.js.1 core-unified-search.js
cp core-unified-search.js.map.1 core-unified-search.js.map

If you Force Reload Nextcloud on your browser, it'll load the new JS files. You might need to restart Apache/Nginx in your case.

@ostasevych
Copy link
Author

Hi! Let me add, that the load of fulltextsearch works well in spite of across file names (generic) search.

@ostasevych
Copy link
Author

Just to update that it's still broken in today's release of 25.0.3 .

This is not recommended, it's an unsupported setup, it will not benefit from other fixes and might introduce other bugs

If you want to get search back, these are my steps:

Step 1: go to Nextcloud's folder

sudo -s
cd /var/www/html/nextcloud/dist

Backup existing files:

cp core-unified-search.js core-unified-search.js.original
cp core-unified-search.js.map core-unified-search.js.map.original

Get the good files:

wget https://raw.githubusercontent.com/nextcloud/server/f0cd60b21bd5d1a0d493dbe222743d3c3040bc98/dist/core-unified-search.js.map
wget https://raw.githubusercontent.com/nextcloud/server/f0cd60b21bd5d1a0d493dbe222743d3c3040bc98/dist/core-unified-search.js

Overwrite old ones:

cp core-unified-search.js.1 core-unified-search.js
cp core-unified-search.js.map.1 core-unified-search.js.map

If you Force Reload Nextcloud on your browser, it'll load the new JS files. You might need to restart Apache/Nginx in your case.

Thanks! It works fine with this patch.

@g1smo
Copy link

g1smo commented Feb 23, 2023

I can confirm this bug is still present; both in 25.0.3 and 26.0.0 beta 4

@pjft
Copy link
Contributor

pjft commented Feb 25, 2023

Just to inform that applying this workaround on 25.0.4 will make search not show up at all now.

It might be related to the new "Contacts Search" dialog. Maybe if there's a way to disable it, it'll work, but I did not dig into that.

If you use this patch, please stay with 25.0.3.

@pjft
Copy link
Contributor

pjft commented Mar 16, 2023

Thank you! Can we expect it to be backported to 25? The auto-backport seems to have failed, and I'd love to test it out.

Our challenge here was, when we press "Load more results" it just breaks and doesn't show anything new.

@masterct88
Copy link

Hi everyone, i can confirm the problem.
One strange thing: after nextcloud fail to load more result, if you search again the same word\file, now the button "Load more results" works! Why?
If i try to search something, but not in "files", the "load more results" WORKS!
problem found on NC 25.0.2, 25.0.4 both docker and dedicated machine.

Hope this info helps.

@ostasevych
Copy link
Author

Hi everyone, i can confirm the problem. One strange thing: after nextcloud fail to load more result, if you search again the same word\file, now the button "Load more results" works! Why? If i try to search something, but not in "files", the "load more results" WORKS! problem found on NC 25.0.2, 25.0.4 both docker and dedicated machine.

What do you mean under "not in files"?

@lotharsm
Copy link

I can replicate this on 25.0.5 and 26.0.0 as well. As soon as I'm in the "Files" app, the "load more" option doesn't work and simply clears out all search results.

When searching from within other apps, I can't replicate the issue and loading search results works as expected.

@masterct88
Copy link

Hi everyone, i can confirm the problem. One strange thing: after nextcloud fail to load more result, if you search again the same word\file, now the button "Load more results" works! Why? If i try to search something, but not in "files", the "load more results" WORKS! problem found on NC 25.0.2, 25.0.4 both docker and dedicated machine.

What do you mean under "not in files"?

If you are in Settings, or Photo, or something different from "Files" it works.
i Hope is now more clear.

@ostasevych
Copy link
Author

Hi everyone, i can confirm the problem. One strange thing: after nextcloud fail to load more result, if you search again the same word\file, now the button "Load more results" works! Why? If i try to search something, but not in "files", the "load more results" WORKS! problem found on NC 25.0.2, 25.0.4 both docker and dedicated machine.

What do you mean under "not in files"?

If you are in Settings, or Photo, or something different from "Files" it works. i Hope is now more clear.

Hi! Thanks for the clarification. Indeed, it works well. Strange situation.

@horvgb
Copy link

horvgb commented Apr 12, 2023

Hi!
I upgraded to 26.0.0 and the NC fail to load more results too! :-(
Ostasevych (thanks!) solutioin does not work in this version!
Please help, my users complains.

Thanks!

@ostasevych
Copy link
Author

ostasevych commented Apr 12, 2023

Hi! I upgraded to 26.0.0 and the NC fail to load more results too! :-( Ostasevych (thanks!) solutioin does not work in this version! Please help, my users complains.

Thanks!

I confirm that. It's strange, that this bug is not being fixed from newer version to the new one.
Meanwhile, the NC Desktop Client works fine! Are any chances to take the proper library code from there?

@ostasevych
Copy link
Author

Hey, so are any chances to fix this weird and annoying bug?..

@mhepplewhite
Copy link

100% very annoying - search is essential for locating items, finding duplicates etc. Please let us have some news

@kboykov
Copy link

kboykov commented May 9, 2023

CAN YOU PLEASE FINALLY FIX THIS BUG... I mean this is one of the core functionalities of this system and it is not working for a long time?!

@glorenzutti
Copy link

Any news on this? Im stuck too.

@brievenbusalex
Copy link

Same problem here. Empty search screen after pressing 'Load more results' in desktop browser. In am running NC 26.0.1. on PHP 8.1 Load more results was working on version 24. Since upgrade version 25 en 26 it is not working anymore.

My workaround: goto another app, for example Talk and do the same search again, then Load more results is working ! Maybe this helps in finding the problem.

@skjnldsv skjnldsv self-assigned this May 16, 2023
@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of 2. developing Work in progress regression medium and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap 1. to develop Accepted and waiting to be taken care of labels May 16, 2023
@skjnldsv skjnldsv added this to the Nextcloud 27 milestone May 16, 2023
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 16, 2023
@pjft
Copy link
Contributor

pjft commented May 25, 2023

I can confirm that this is now fixed on 25.0.7.

Thank you @szaimen for looking into this.

@szaimen
Copy link
Contributor

szaimen commented May 25, 2023

It was @skjnldsv who fixed this so the praise goes to him!

@pjft
Copy link
Contributor

pjft commented May 25, 2023

Thank you @skjnldsv then, of course :)

@LibertusDio
Copy link

love to see it gets resolved, took a while though. Now I can push to newer version of server, search is critical to me though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.