nextcloud-workflow-media-converter icon indicating copy to clipboard operation
nextcloud-workflow-media-converter copied to clipboard

Choose Folder option in flow does not work.

Open sveken opened this issue 1 year ago • 33 comments

Steps to reproduce

  1. Create flow for media conversion
  2. Choose any of the move options like after output is ready "Move output to specific folder"
  3. The "choose folder" option does not do anything/open any picker

Expected behaviour

The choose folder picker should pop up or some form of text field to enter path

Actual behaviour

Nothing happens.

Workflow Media Converter app

Workflow Media Converter app version: (see apps admin page: /index.php/settings/apps) 1.9.0

Server configuration

Operating system: Ubuntu/RedHat/... Truenas Scale/ Debian

Web server: Apache/Nginx Nginx Database: MySQL/Maria/SQLite/PostgreSQL PostgresSQL

PHP version: 8.2.14

Nextcloud Version: (see admin page) 28.0.1

Where did you install Nextcloud from: Truecharts Catalogue

Signing status:

Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.

No errors have been found.

List of activated apps: Activity Announcment Center Automated Media Conversion Brute-force Settings Calender Camera RAW Previews Circles CLient Push Collaborative Tags Comments Configurable share links Contacts Contacts interaction Dashboard Deck Deleted files End-end encryption excalidraw integration External Storage Federation FIle remidners File sharing FIle automated Tagging First run wiz Forms Guests Log Reader Memories Monitoring Nextcloud Announcments Nextcloud Office Notes Notications PAssword Policy Passwords Passwords andbook PDF Viewer PhoneTrack Photos Polls Preview Generator Privacy Recongize Reccomendations Registration Related Resources Share by Mail Support talk Tasks text 2FA TOPP Provider 2FA Webauthn Usage Survey Update Notication User Status Versions Weather Status

sveken avatar Jan 16 '24 05:01 sveken

I encountered this problem in Google Chrome, and it was solved when I switched back to Edge browser. I suspected that the ad plug-in was blocking it. You can try switching to a different browser or checking the browser plug-in.

WantSleep0419 avatar Jan 16 '24 15:01 WantSleep0419

I have just tried in firefox, Chrome, and edge, also in incognito. Also tried Chrome on my phone via cell connection. Behavior stays the same.

sveken avatar Jan 16 '24 22:01 sveken

Same behavior here with the following setup:

Ubuntu Server 22.04 LTS Nextcloud version 27.1.5 PHP version 8.1.27 MySQL version 10.6.12 Apache 2.4

Also tried different browsers (chrome, firefox) with different browser protection setups without effect on the "Choose Folder" Button

Misls avatar Jan 17 '24 14:01 Misls

I think it might have something to do with the fact that my/our Nextcloud installation is in a in a directory, and not directly in the index domainname (eg. example.com/nextcloud). Here are my browser logs:

You need to fill either the text or the ariaLabel props in the button component.
Object { text: undefined, ariaLabel: null }

Object { _uid: 6, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": [], … }
workflow_media_converter-personalSettings.js:2:701499
Loading failed for the <script> with source “https://[REDACTED]/apps/workflow_media_converter/js/workflow_media_converter-vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-7228d0.js?v=5959475e462b19fc49c0”. workflow_media_converter:1:1
Loading failed for the <script> with source “https://[REDACTED]/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_legacy_mjs.js?v=a5e97bb3a2cce054c0bb”. workflow_media_converter:1:1
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://[REDACTED]/apps/workflow_media_converter/js/workflow_media_converter-vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-7228d0.js?v=5959475e462b19fc49c0 (“script-src”). workflow_media_converter-personalSettings.js:2:663869
ChunkLoadError: Loading chunk vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-7228d0 failed.
(error: https://[REDACTED]/apps/workflow_media_converter/js/workflow_media_converter-vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-7228d0.js?v=5959475e462b19fc49c0)
    j https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    e https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    e https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    pick https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    t https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    c https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    F https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    N https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    Ws https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    i https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    openFilePicker https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    openFilePicker https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    openFilePicker https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    click https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    Cs https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    s https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
    _wrapper https://[REDACTED]/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-personalSettings.js?v=72f01f5b-40:2
workflow_media_converter-personalSettings.js:2:231421
Content-Security-Policy: The page’s settings blocked the loading of a resource at https://[REDACTED]/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_legacy_mjs.js?v=a5e97bb3a2cce054c0bb (“script-src”). workflow_media_converter-personalSettings.js:2:663869
GET
https://[REDACTED]/nextcloud/apps/theming/image/logo?v=40
[HTTP/2 404  920ms]

GET
https://[REDACTED]/nextcloud/apps/theming/image/logo?v=40
[HTTP/2 404  630ms]

printplaatreparatie avatar Jan 24 '24 10:01 printplaatreparatie

Note that the failed command is trying to fetch a resource from domainname.example/apps instead of domainname.example/nextcloud/apps

printplaatreparatie avatar Jan 24 '24 10:01 printplaatreparatie

My nextcloud is installed at the root of the domain, and I still have this issue.

I'll get those logs as soon as I can tomorrow.

sveken avatar Jan 24 '24 10:01 sveken

Are there helpful logs that you can share?

printplaatreparatie avatar Jan 24 '24 10:01 printplaatreparatie

mediaconvert-1706132819743.log Here we go. Seems to be 404ing on the button.

sveken avatar Jan 24 '24 21:01 sveken

The button stopped working in my setup somewhere after Dec. 12th, 2023. It still worked when I did some tests for this reply.

It could have something to do with commit 048f0ce that enables the use of command line flags. This line maybe?

https://github.com/cwilby/nextcloud-workflow-media-converter/blob/165d24b4c499e0e7567f6f6a16de7b3352cc593e/src/mixins/filepicker.js#L2

printplaatreparatie avatar Feb 07 '24 14:02 printplaatreparatie

I think the problem is with writing /apps/ in the url path, shouldn't it be /custom_apps/? I tried accessing it manually, the requested js file can be accessed normally

n0paleon avatar Mar 16 '24 23:03 n0paleon

Not for me. It has definitely something to do with referring to the root folder. I can reach https://domainname.example/nextcloud/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-xxxxx_mjs.js but the button directs to https://domainname.example/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-xxxxx_mjs.js'.

printplaatreparatie avatar Mar 18 '24 10:03 printplaatreparatie

I installed this to test converting stuff for some DLNA setup but I found this bug… Oddly Chromium gives more info than Firefox which only mentions CSP as a reason for the block:

workflow_media_converter-personalSettings.js?v=f505562d-0:2 Refused to load the script 'https://[domain]/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-csK3cpe5_mjs.js?v=bc706ee6becf1a314d5a' because it violates the following Content Security Policy directive: "script-src 'nonce-L3d5QVRYNnNRU1FDb0tuTSsyOXJkenBBTVNaSnBvMDA5R29TdnNIYzFVND06emp2ckNqTFBObFpMbVoraXlUNG5JVk16WmtnUjN1cHhoUVZma2FMcCtqcz0='". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

r.l @ workflow_media_converter-personalSettings.js?v=f505562d-0:2

workflow_media_converter-personalSettings.js?v=f505562d-0:2 ChunkLoadError: Loading chunk node_modules_nextcloud_dialogs_dist_chunks_index-csK3cpe5_mjs failed.
(error: https://[domain]/apps/workflow_media_converter/js/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-csK3cpe5_mjs.js?v=bc706ee6becf1a314d5a)
    at r.f.j (workflow_media_converter-personalSettings.js?v=f505562d-0:2:888379)
    at workflow_media_converter-personalSettings.js?v=f505562d-0:2:886607
    at Array.reduce (<anonymous>)
    at r.e (workflow_media_converter-personalSettings.js?v=f505562d-0:2:886585)
    at u.pick (workflow_media_converter-personalSettings.js?v=f505562d-0:2:889765)
    at workflow_media_converter-personalSettings.js?v=f505562d-0:2:905160
    at v (workflow_media_converter-personalSettings.js?v=f505562d-0:2:898868)
    at Generator.<anonymous> (workflow_media_converter-personalSettings.js?v=f505562d-0:2:900214)
    at Generator.next (workflow_media_converter-personalSettings.js?v=f505562d-0:2:899297)
    at V (workflow_media_converter-personalSettings.js?v=f505562d-0:2:904783)

Does the script need to be declared in some way to the core to get that nonce forwarded or something?

mmuman avatar Mar 22 '24 22:03 mmuman

So from what I understand personalSettings.js attemps to load this …chunks_index….js without passing around that nonce that itself was loaded with, when the CSP forbids that.

Could it be we just need a --no-unsafe-inline arg to npm!?

I don't even know how people are supposed to build this, there's nothing in the README about that… and no ./configure :-P

mmuman avatar Mar 24 '24 23:03 mmuman

Ohhh, a Makefile :heart_eyes:

mmuman avatar Mar 26 '24 00:03 mmuman

Still no idea where to fix that though…

mmuman avatar Mar 26 '24 00:03 mmuman

Got a fix \o/

mmuman avatar Mar 26 '24 23:03 mmuman

All these hours for a oneliner :tired_face:

mmuman avatar Mar 27 '24 00:03 mmuman

mediaconvert-log.log Installed the update today and still no change on my end. Tried restarting the container after the update, cleared browser cache.

sveken avatar Apr 01 '24 21:04 sveken

Same here, @cwilby please reopen this issue.

printplaatreparatie avatar Apr 02 '24 08:04 printplaatreparatie

Are you using HTTP or a properly configured HTTPS server?

mmuman avatar Apr 02 '24 16:04 mmuman

HTTPS

printplaatreparatie avatar Apr 02 '24 16:04 printplaatreparatie

Maybe the NC version ? Here I'm using 27.1.2…

mmuman avatar Apr 02 '24 16:04 mmuman

Kind of staring into a black box on this one. I'm pushing a change to the build script, it may be that the dev build is being released instead of the production build.

cwilby avatar Apr 02 '24 16:04 cwilby

Im using HTTPS and 28.0.3

sveken avatar Apr 02 '24 22:04 sveken

Nextcloud 28.0.4 (docker/apache) workflow-media-converter 1.10.3 with ssl offload on nginx (restart container, remove - reinstall media converter - does not help)

settings/user/workflow_media_converter

Choose folder button do not work with Error (in Chrome)

https://[my-server]/custom_apps/workflow_media_converter/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-RkOaxczZ_mjs.js?v=b503adf395d4b1c57cc4

Request Method: GET Status Code: 404 Not Found

Same in Edge

at r.f.j (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:943334)
at workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:941562
at Array.reduce (<anonymous>)
at r.e (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:941540)
at y.pick (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:946409)
at workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:961784
at v (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:955504)
at Generator.<anonymous> (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:956846)
at Generator.next (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:955933)
at X (workflow_media_converter-personalSettings.js?v=2dc04f56-22:2:961407)

nginx log

[03/Apr/2024:11:29:12 +0300] "GET /custom_apps/workflow_media_converter/workflow_media_converter-node_modules_nextcloud_dialogs_dist_chunks_index-RkOaxczZ_mjs.js?v=b503adf395d4b1c57cc4 HTTP/2.0" 404 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"

oliut avatar Apr 03 '24 08:04 oliut

Oh I didn't notice you were using a flow, I never actually tried before. Still I just tried creating one and it works here.

mmuman avatar Apr 03 '24 20:04 mmuman

I don't get where this "custom_apps" is used, I have no URL with that loaded anywhere when I use it… Is that introduced in version 28?

mmuman avatar Apr 03 '24 21:04 mmuman

/custom_apps/ is the second app folder that is writable. if I reinstall workflow-media-converter in /apps/ folder - error (button not work) stays the same. And some previous versions of workflow-media-converter (1.9.3) I was able to "fix" by moving it from custom_apps to apps. but for current version (1.10.3) this workaround not work any more.

oliut avatar Apr 07 '24 10:04 oliut

I am also experiencing this issue on a new deployment of an LXC container.

barrettsoftware avatar Apr 09 '24 15:04 barrettsoftware

cp /var/www/html/apps/workflow_media_converter/js/*.js /var/www/html/apps/workflow_media_converter/

workaround for v1.10.3 that makes button work for me

oliut avatar Apr 09 '24 19:04 oliut