dicomviewer icon indicating copy to clipboard operation
dicomviewer copied to clipboard

Blank screen when click on dicom dir

Open vandman opened this issue 1 year ago • 14 comments

Hi, When I want to view a scan, I get a blank screen whenever I launch the dicom viewer.

It looks like one of the dicom scrip violate the Content Security Policy directive (CSP), so it is not loaded. It does that on Firefox, Edge and Chrome. image Regards Pierre

php occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nc.nikolov.fr",
            "nc.desmeloizes.fr"
        ],
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db",
            "@eaDir"
        ],
        "maintenance_window_start": 1,
        "activity_expire_days": 14,
        "dbtype": "mysql",
        "version": "28.0.5.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "onlyoffice": {
            "DocumentServerUrl": "\/oo\/",
            "DocumentServerInternalUrl": "http:\/\/oo-document\/",
            "StorageUrl": "https:\/\/nc.nikolov.fr\/"
        },
        "allow_local_remote_servers": true,
        "maintenance": false,
        "theme": "",
        "updater.release.channel": "stable",
        "encryption.legacy_format_support": false,
        "auth.bruteforce.protection.enabled": true,
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "app_install_overwrite": [
            "dicomviewer",
            "ocr",
            "radio",
            "camerarawpreviews",
            "joplin"
        ],
        "default_language": "fr",
        "default_phone_region": "FR",
        "default_locale": "fr_FR",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\Postscript",
            "OC\\Preview\\StarOffice",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\Font"
        ],
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "preview_max_scale_factor": 1,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/nc.nikolov.fr",
        "overwriteprotocol": "https",
        "overwritewebroot": "\/",
        "filelocking.enabled": true,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "6379",
            "timeout": 0
        },
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpsecure": "ssl",
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": false,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "trashbin_retention_obligation": "auto, 60",
        "versions_retention_obligation": "auto, 30",
        "remember_login_cookie_lifetime": "18000",
        "objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "nextcloud",
                "autocreate": true,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "hostname": "s3.nikolov.fr",
                "port": 443,
                "use_ssl": true,
                "region": "fr-paris-07",
                "use_path_style": true
            }
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "log_type": "file",
        "loglevel": 2,
        "logdateformat": "Y-m-d H:i:s",
        "log_rotate_size": 104857600,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "log_type_audit": "file",
        "logfile_audit": "\/var\/www\/html\/data\/audit.log",
        "jpeg_quality": "60"
    }
}
php occ app:list
Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - analytics: 4.13.0
  - announcementcenter: 6.8.1
  - app_api: 2.6.0
  - assistant: 1.0.9
  - auto_groups: 1.5.3
  - bruteforcesettings: 2.8.0
  - calendar: 4.7.6
  - circles: 28.0.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.3
  - contactsinteraction: 1.9.0
  - context_chat: 2.1.2
  - dashboard: 7.8.0
  - dav: 1.29.1
  - deck: 1.12.2
  - dicomviewer: 2.1.2
  - event_update_notification: 2.4.0
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_mindmap: 0.0.30
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_retention: 1.17.2
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - forms: 4.2.4
  - groupfolders: 16.0.7
  - integration_openai: 2.0.1
  - integration_openproject: 2.6.3
  - limit_login_to_ip: 4.1.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.7.1
  - music: 1.11.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - polls: 7.1.1
  - previewgenerator: 5.5.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recognize: 6.1.1
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.7
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - sharepoint: 1.16.0
  - socialsharing_email: 3.1.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tasks: 0.16.0
  - text: 3.9.1
  - theming: 2.3.0
  - translate: 2.1.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflow_pdf_converter: 1.13.0
  - workflowengine: 2.10.0
Disabled:
  - encryption: 2.16.0
  - federation: 1.18.0 (installed 1.10.1)
  - files_antivirus: 5.5.4 (installed 5.5.4)
  - onlyoffice: 9.2.2 (installed 9.2.2)
  - piwik: 0.12.0 (installed 0.12.0)
  - support: 1.11.1 (installed 1.3.0)
  - twofactor_totp: 10.0.0-beta.2
  - unsplash: 2.2.1 (installed 2.2.1)
  - user_ldap: 1.19.0

vandman avatar Jun 18 '24 13:06 vandman

I get a black screen (I have a dark theme). What I see in firefox is that some js script are blocked. Look at the screenshot. I have no other log in nexcloud.log. I have Firefox 127.0 (64 bits) in ArchLinux. Capture d’écran du 2024-06-16 23-11-37 Regards

vandman avatar Jun 18 '24 13:06 vandman

I can confirm this issue, I am also getting a black screen. EDIT: I have just found out that the issue only occurs for me when the directory is external storage (other local directory in my case). When I copy the directory to the Nextcloud data directory, it works just fine.

Medformatik avatar Jul 12 '24 21:07 Medformatik

I also receive a CSP error: dicom

This is on NC 28.

clawoflight avatar Jul 26 '24 17:07 clawoflight

i have the same issue on Nextcloud Hub 8

sudo -u www-data php8.2 /var/www/nextcloud/occ config:list system
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.0.12",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "default_phone_region": "ISO_3166-2:GR",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "29.0.2.2",
        "overwrite.cli.url": "http:\/\/192.168.0.12",
        "overwriteprotocol": "https",
        "overwritehost": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "filelocking.enabled": false,
        "app_install_overwrite": [
            "duplicatefinder",
            "deckimportfromtrello",
            "dicomviewer",
            "files_rightclick"
        ],
        "memcache.local": "\\OC\\Memcache\\Memcached",
        "memcached_servers": [
            [
                "localhost",
                11211
            ]
        ],
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance_window_start": 1,
        "apps_paths": [
            {
                "path": "\/var\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            }
        ]
    }
}
Enabled:
  - activity: 2.21.1
  - camerarawpreviews: 0.8.5
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - deck: 1.13.1
  - dicomviewer: 2.1.2
  - drawio: 3.0.2
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.0
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - mail: 3.7.6
  - maps: 1.4.0
  - music: 2.0.0
  - nextcloud_announcements: 1.18.0
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - password_policy: 1.19.0
  - photos: 2.5.0
  - previewgenerator: 5.6.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - spreed: 19.0.7
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - text: 3.10.0
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - unroundedcorners: 1.1.3
  - updatenotification: 1.19.1
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - encryption: 2.17.0
  - files_rightclick: 0.15.1 (installed 0.15.1)
  - suspicious_login: 7.0.0
  - twofactor_totp: 11.0.0-dev
  - user_ldap: 1.20.0

When i open with dicom viewer i just get black screen...

eimparas avatar Aug 01 '24 07:08 eimparas

I can confirm this issue, I am also getting a black screen. EDIT: I have just found out that the issue only occurs for me when the directory is external storage (other local directory in my case). When I copy the directory to the Nextcloud data directory, it works just fine.

Same for me... it seems external storage is getting handled by apps with other permissions than the nc data dir... A similar issue can be seen with a shared draw.io file. It can't get opened if the file is saved in external storage.

DerP4si avatar Aug 08 '24 11:08 DerP4si

@DerP4si

Same for me... it seems external storage is getting handled by apps with other permissions than the nc data dir... A similar issue can be seen with a shared draw.io file. It can't get opened if the file is saved in external storage.

I indeed have my DICOMs on external storage i too get a black screen when i "open with DCOM viewer" , as a matter of fact all my files , but the mentioned draw.io works just fine

Now i tested again , moved one small folder containing DICOM files to local , not external , storage , it was able to load the app's GUI (in contrast to when i open files from external storage) . But it never loaded the images...

these were the logs on the browser console: image

eimparas avatar Aug 08 '24 21:08 eimparas

Now i tested again , moved one small folder containing DICOM files to local , not external , storage , it was able to load the app's GUI (in contrast to when i open files from external storage) . But it never loaded the images...

Same error as me: UI chrome loads, contents fail to load due to CSP errors.

clawoflight avatar Aug 09 '24 07:08 clawoflight

HI, thanks for this app. This will be very useful for me to navigate and visualise those CDs received from the hospitals!

I'm having the similar error as show in https://github.com/ayselafsar/dicomviewer/issues/120#issuecomment-2276655009.

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http: * 'unsafe-eval' 'wasm-unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-vXVuQCdE0e+lN0aBlYXq4nQs56d9JdqUWqMItRpGEs0='), or a nonce ('nonce-...') is required to enable inline execution.

More over, my nextcloud 29 installation is under the /nextcloud folder, ie. not directly on the web root. It looks like that the URLs requested from the page dont take that into accountt. I'd expect that the request URL are /nextcloud/{assets|benchmark}/... instead of {assets|benchmark}/...

/assets/android-chrome-144x144.png:1 :Failed to load resource: the server responded with a status of 404 ()

Error while trying to use the following icon from the Manifest: https://my.domain.tld/assets/android-chrome-144x144.png (Download error or resource isn't a valid image)

/benchmarks/d-intel.json:1 :Failed to load resource: the server responded with a status of Failed to load resource: the server responded with a status of 404 ()

soncaokim avatar Sep 28 '24 15:09 soncaokim

HI, thanks for this app. This will be very useful for me to navigate and visualise those CDs received from the hospitals!

I'm having the similar error as show in #120 (comment).

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http: * 'unsafe-eval' 'wasm-unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-vXVuQCdE0e+lN0aBlYXq4nQs56d9JdqUWqMItRpGEs0='), or a nonce ('nonce-...') is required to enable inline execution.

More over, my nextcloud 29 installation is under the /nextcloud folder, ie. not directly on the web root. It looks like that the URLs requested from the page dont take that into accountt. I'd expect that the request URL are /nextcloud/{assets|benchmark}/... instead of {assets|benchmark}/...

/assets/android-chrome-144x144.png:1 :Failed to load resource: the server responded with a status of 404 ()

Error while trying to use the following icon from the Manifest: https://my.domain.tld/assets/android-chrome-144x144.png (Download error or resource isn't a valid image)

/benchmarks/d-intel.json:1 :Failed to load resource: the server responded with a status of Failed to load resource: the server responded with a status of 404 ()

I encountered the same error-message

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http: * 'unsafe-eval' 'wasm-unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-vXVuQCdE0e+lN0aBlYXq4nQs56d9JdqUWqMItRpGEs0='), or a nonce ('nonce-...') is required to enable inline execution.

in NC29 but in the end, my problem was caused by #119. I renamed the folder to avoid special characters and it worked. The mentioned error still applies tho.

deafloo avatar Oct 16 '24 11:10 deafloo

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 15 '25 01:04 github-actions[bot]

still valid.

clawoflight avatar Apr 15 '25 07:04 clawoflight

yep. Its not working no matter what i do

eimparas avatar Apr 15 '25 07:04 eimparas

hallelujah

DICOM Viewer works again on Nextcloud Hub 10 (31.0.4) ! Version 2.3.1,

Image

but it seems it fails to read DICOMDIR files

If i open the "folder" in a dir structure of /folder/studyFiles it fails , if i go directly on studyFiles it works. "folder" has the DICOMDIR file that points to studyFiles.

This used to work tho..

eimparas avatar Apr 23 '25 20:04 eimparas

The issue appears to be happening whenever its a public link and there is no user logged in. Once I log in its fine so it must be some issue with permissions.

wjstone avatar Jun 11 '25 22:06 wjstone

I got the same, I had put the scans on a NAS folder mounted into nextcloud using SMB. (It's always been there so - also when dicomviewer was able to display it). Agreed it makes sense to point at nextcloud permissions in this case. One part that could match with the CSP problem is that I had only http for this url, I need to make it 'proper' with some cert and see if the error resolves.

FlorianHeigl avatar Oct 08 '25 05:10 FlorianHeigl