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]: "Restore" failed on some elements - String contains non ISO-8859-1 code point #39445

Closed
5 of 8 tasks
Mzhanping opened this issue Jul 18, 2023 · 7 comments · Fixed by #39842
Closed
5 of 8 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug

Comments

@Mzhanping
Copy link

Mzhanping commented Jul 18, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

Hello, I have encountered a bug. After deleting a Chinese name file on the client or web page, I will enter 'deleted files' to restore it, and it will prompt' Restore 'failed on some elements.

The console displays

[ERROR] files: TypeError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point

Non Chinese files can be deleted and restored normally.

Steps to reproduce

  1. Create a new Chinese name file such as "Chinese. md"

  2. Delete the file

  3. Enter deleted files

  4. Select the file to restore

Expected behavior

The file is restored normally.

Installation method

Other Community project

Nextcloud Server version

27

Operating system

Other

PHP engine version

None

Web server

None

Database engine version

None

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

None

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

sudo -u www-data php occ config:list system
{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "customclient_desktop": "https:\/\/n.mmk12.cn:8443\/s\/4z9NQDnkCEkJGL4",
        "customclient_android": "https:\/\/n.mmk12.cn:8443\/s\/kKyTG2p9zk785b4",
        "default_phone_region": "CN",
        "default_language": "zh_CN",
        "default_locale": "zh",
        "force_locale": "zh_CN",
        "auth.bruteforce.protection.enabled": false,
        "simpleSignUpLink.shown": false,
        "skeletondirectory": "",
        "trashbin_retention_obligation": "auto,30",
        "proxy": "192.168.10.3:7890",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.10.2:1234",
            "n.mmk12.cn"
        ],
        "overwritehost": "n.mmk12.cn:8443",
        "overwriteprotocol": "https",
        "overwrite.cli.url": "http:\/\/192.168.10.2:1234",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "27.0.0.8",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "app_install_overwrite": [
            "backup"
        ],
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - admin_audit: 1.17.0
  - circles: 27.0.0
  - cloud_federation_api: 1.10.0
  - collectives: 2.6.1
  - comments: 1.17.0
  - contacts: 5.3.2
  - contactsinteraction: 1.8.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_mindmap: 0.0.28
  - files_pdfviewer: 2.8.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - groupfolders: 15.0.1
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - notify_push: 0.6.3
  - oauth2: 1.15.0
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - richdocuments: 8.1.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.0
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - backup: 1.2.0 (installed 1.2.0)
  - bruteforcesettings: 2.7.0
  - dashboard: 7.7.0 (installed 7.7.0)
  - encryption: 2.15.0
  - files_external: 1.19.0 (installed 1.19.0)
  - files_fulltextsearch: 27.0.0 (installed 27.0.0)
  - fulltextsearch: 27.0.0 (installed 27.0.0)
  - fulltextsearch_elasticsearch: 27.0.0 (installed 27.0.0)
  - spreed: 17.0.1 (installed 17.0.1)
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0
  - user_ldap: 1.17.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@Mzhanping Mzhanping added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 18, 2023
@joshtrichards
Copy link
Member

Hi @Mzhanping - Thanks for reporting this. This may be enough to track it down, but to save time and reduce error: Are there a couple more lines to that error message? They may start with at [...] or something similar. If so, please provide the entire error output. Thanks!

@joshtrichards
Copy link
Member

Maybe we need to do some encoding here:

async exec(node: Node) {
try {
const destination = generateRemoteUrl(`dav/trashbin/${getCurrentUser()?.uid}/restore/${node.basename}`)
await axios({
method: 'MOVE',
url: node.source,
headers: {
destination,
},
})

Also shouldn't this me more like:

headers {
   Destination: destination,
},

Something more like here:

try {
await axios({
method: 'MOVE',
url: oldSource,
headers: {
Destination: encodeURI(this.source.source),
},
})

@Mzhanping
Copy link
Author

Mzhanping commented Jul 18, 2023

Hi @Mzhanping - Thanks for reporting this. This may be enough to track it down, but to save time and reduce error: Are there a couple more lines to that error message? They may start with at [...] or something similar. If so, please provide the entire error output. Thanks!

@joshtrichards Thank you very much for your reply. This is an error prompted by the console. The complete prompt is as follows:

core-common.js?v=ea8a62a3-4:2  [ERROR] files: TypeError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point. {app: 'files', uid: '15383387654', level: 2}
value @ core-common.js?v=ea8a62a3-4:2
value @ core-common.js?v=ea8a62a3-4:2
exec @ restoreAction.ts:63
await in exec(异步)
(匿名) @ restoreAction.ts:68
execBatch @ restoreAction.ts:68
onActionClick @ FilesListHeaderActions.vue:112
click @ FilesListHeaderActions.vue:1
click @ core-common.js?v=ea8a62a3-4:2
Tn @ core-common.js?v=ea8a62a3-4:2
n @ core-common.js?v=ea8a62a3-4:2
click @ core-common.js?v=ea8a62a3-4:2
Tn @ core-common.js?v=ea8a62a3-4:2
n @ core-common.js?v=ea8a62a3-4:2
a._wrapper @ core-common.js?v=ea8a62a3-4:2

Thank you again for your busy reply.

@solracsf solracsf changed the title [Bug]: "Restore" failed on some elements [Bug]: "Restore" failed on some elements - String contains non ISO-8859-1 code point Jul 18, 2023
@bilibiliLEO
Copy link

I had the same problem with NC27.0.0

@avsob
Copy link

avsob commented Aug 25, 2023

I had the same issue with cyrillic in NC27.0.2

I solved it like this.
You need to replace the text in the file /nextcloud/dist/files_trashbin-main.js
.concat(e.basename)
by
.concat(encodeURI(e.basename))

Maybe it will be useful to someone.

@kesselb
Copy link
Contributor

kesselb commented Aug 25, 2023

#39842

@kesselb
Copy link
Contributor

kesselb commented Aug 25, 2023

27.1.0 (2023-09-16)

@kesselb kesselb closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants