netdata / netdata/netdata

[Bug]: CORS blocks app.netdata.cloud/api

Open
#16,387 6 comments 0 reactions 1 assignee View on GitHub

@novykh is already working on this.

Since Nov 12, 2023.

area/web bug
Dominant language
Go
Stars
80.6k
Forks
6.6k
Avg merge
15h 36m
Merged PRs (30d)
304

Description

Bug description

When clicking on 'Learn more about this alert' under an active alert
the netdata assistant shows 'Something went wrong'.

'''
Access to XMLHttpRequest at 'https://app.netdata.cloud/api/v1/troubleshoot' from origin 'http://redacted.domain.com:19999' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
'''

Expected behavior

Information about the alert should show

Steps to reproduce
  1. Open the alerts tab > active or alert configurations
  2. Navigate to any alert and open the alert info
  3. Click on 'Learn more about this alert'
  4. The netdata assistant say Something went wrong
Installation method

kickstart.sh

System info
/etc/os-release:PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
/etc/os-release:NAME="Debian GNU/Linux"
/etc/os-release:VERSION_ID="12"
/etc/os-release:VERSION="12 (bookworm)"
/etc/os-release:VERSION_CODENAME=bookworm
/etc/os-release:ID=debian
Netdata build info
Packaging:
    Netdata Version ____________________________________________ : v1.43.2
    Installation Type __________________________________________ : binpkg-deb
    Package Architecture _______________________________________ : x86_64
    Package Distro _____________________________________________ :  
    Configure Options __________________________________________ :  '--build=x86_64-linux-gnu' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--with-user=netdata' '--with-math' '--with-zlib' '--with-webdir=/var/lib/netdata/www' '--disable-dependency-tracking' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/usr/src/netdata=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/usr/src/netdata=. -fstack-protector-strong -Wformat -Werror=format-security'
Default Directories:
    User Configurations ________________________________________ : /etc/netdata
    Stock Configurations _______________________________________ : /usr/lib/netdata/conf.d
    Ephemeral Databases (metrics data, metadata) _______________ : /var/cache/netdata
    Permanent Databases ________________________________________ : /var/lib/netdata
    Plugins ____________________________________________________ : /usr/libexec/netdata/plugins.d
    Static Web Files ___________________________________________ : /var/lib/netdata/www
    Log Files __________________________________________________ : /var/log/netdata
    Lock Files _________________________________________________ : /var/lib/netdata/lock
    Home _______________________________________________________ : /var/lib/netdata
Operating System:
    Kernel _____________________________________________________ : Linux
    Kernel Version _____________________________________________ : 5.15.108-1-pve
    Operating System ___________________________________________ : unknown
    Operating System ID ________________________________________ : unknown
    Operating System ID Like ___________________________________ : unknown
    Operating System Version ___________________________________ : unknown
    Operating System Version ID ________________________________ : 12
    Detection __________________________________________________ : unknown
Hardware:
    CPU Cores __________________________________________________ : 1
    CPU Frequency ______________________________________________ : 3500000000
    CPU Architecture ___________________________________________ : 536870912
    RAM Bytes __________________________________________________ : 16501008523264
    Disk Capacity ______________________________________________ : x86_64
    Virtualization Technology __________________________________ : none
    Virtualization Detection ___________________________________ : systemd-detect-virt
Container:
    Container __________________________________________________ : lxc
    Container Detection ________________________________________ : systemd-detect-virt
    Container Orchestrator _____________________________________ : none
    Container Operating System _________________________________ : Debian GNU/Linux
    Container Operating System ID ______________________________ : debian
    Container Operating System ID Like _________________________ : unknown
    Container Operating System Version _________________________ : 12 (bookworm)
    Container Operating System Version ID ______________________ : 12
    Container Operating System Detection _______________________ : /etc/os-release
Features:
    Built For __________________________________________________ : Linux
    Netdata Cloud ______________________________________________ : YES
    Health (trigger alerts and send notifications) _____________ : YES
    Streaming (stream metrics to parent Netdata servers) _______ : YES
    Replication (fill the gaps of parent Netdata servers) ______ : YES
    Streaming and Replication Compression ______________________ : YES (lz4)
    Contexts (index all active and archived metrics) ___________ : YES
    Tiering (multiple dbs with different metrics resolution) ___ : YES (5)
    Machine Learning ___________________________________________ : YES
Database Engines:
    dbengine ___________________________________________________ : YES
    alloc ______________________________________________________ : YES
    ram ________________________________________________________ : YES
    map ________________________________________________________ : YES
    save _______________________________________________________ : YES
    none _______________________________________________________ : YES
Connectivity Capabilities:
    ACLK (Agent-Cloud Link: MQTT over WebSockets over TLS) _____ : YES
    static (Netdata internal web server) _______________________ : YES
    h2o (web server) ___________________________________________ : YES
    WebRTC (experimental) ______________________________________ : NO
    Native HTTPS (TLS Support) _________________________________ : YES
    TLS Host Verification ______________________________________ : YES
Libraries:
    LZ4 (extremely fast lossless compression algorithm) ________ : YES
    zlib (lossless data-compression library) ___________________ : YES
    Judy (high-performance dynamic arrays and hashtables) ______ : YES (bundled)
    dlib (robust machine learning toolkit) _____________________ : YES (bundled)
    protobuf (platform-neutral data serialization protocol) ____ : YES (system)
    OpenSSL (cryptography) _____________________________________ : YES
    libdatachannel (stand-alone WebRTC data channels) __________ : NO
    JSON-C (lightweight JSON manipulation) _____________________ : YES
    libcap (Linux capabilities system operations) ______________ : NO
    libcrypto (cryptographic functions) ________________________ : YES
    libm (mathematical functions) ______________________________ : YES
    jemalloc ___________________________________________________ : NO
    TCMalloc ___________________________________________________ : NO
Plugins:
    apps (monitor processes) ___________________________________ : YES
    cgroups (monitor containers and VMs) _______________________ : YES
    cgroup-network (associate interfaces to CGROUPS) ___________ : YES
    proc (monitor Linux systems) _______________________________ : YES
    tc (monitor Linux network QoS) _____________________________ : YES
    diskspace (monitor Linux mount points) _____________________ : YES
    freebsd (monitor FreeBSD systems) __________________________ : NO
    macos (monitor MacOS systems) ______________________________ : NO
    statsd (collect custom application metrics) ________________ : YES
    timex (check system clock synchronization) _________________ : YES
    idlejitter (check system latency and jitter) _______________ : YES
    bash (support shell data collection jobs - charts.d) _______ : YES
    debugfs (kernel debugging metrics) _________________________ : YES
    cups (monitor printers and print jobs) _____________________ : YES
    ebpf (monitor system calls) ________________________________ : YES
    freeipmi (monitor enterprise server H/W) ___________________ : YES
    nfacct (gather netfilter accounting) _______________________ : YES
    perf (collect kernel performance events) ___________________ : YES
    slabinfo (monitor kernel object caching) ___________________ : YES
    Xen ________________________________________________________ : NO
    Xen VBD Error Tracking _____________________________________ : NO
Exporters:
    AWS Kinesis ________________________________________________ : NO
    GCP PubSub _________________________________________________ : NO
    MongoDB ____________________________________________________ : YES
    Prometheus (OpenMetrics) Exporter __________________________ : YES
    Prometheus Remote Write ____________________________________ : YES
    Graphite ___________________________________________________ : YES
    Graphite HTTP / HTTPS ______________________________________ : YES
    JSON _______________________________________________________ : YES
    JSON HTTP / HTTPS __________________________________________ : YES
    OpenTSDB ___________________________________________________ : YES
    OpenTSDB HTTP / HTTPS ______________________________________ : YES
    All Metrics API ____________________________________________ : YES
    Shell (use metrics in shell scripts) _______________________ : YES
Debug/Developer Features:
    Trace All Netdata Allocations (with charts) ________________ : NO
    Developer Mode (more runtime checks, slower) _______________ : NO
Additional info
content.js:432 Unable to check top-level optout: Blocked a frame with origin "https://registry.my-netdata.io" from accessing a cross-origin frame.
checkPageOptout @ content.js:432
(anonymous) @ content.js:446
await in (anonymous) (async)
(anonymous) @ content.js:516
(anonymous) @ content.js:518
Show 4 more frames
Show less
app.ac7dc8d98b5fc964d88d.js:1 Running in development mode version: cloud-frontend 6.59.1
alerts#metrics_correlation=false&after=1699754391000&before=1699754875000&utc=America%2FToronto&offset=-5&timezoneName=Eastern%20Time%20(US%20&modal=alertDetailsModal&modalTab=&modalParams=alertId%3D59de1bf6-1ff9-4767-8659-b56a6d2956b4&selectedIntegrationCategory=deploy.operating-systems&force_play=false&local--chartName-val=menu_system&local-nodesView-nodeIdToGo-val=menu_Live&local--sidebarOpen-bool=true&local-overview-sidebarTab-val=chartIndexing&local-2906f1ac-7ff4-11ee-a8dc-ca68892189e7-chartName-val=menu_systemd_submenu_cpu:1 Access to XMLHttpRequest at 'https://app.netdata.cloud/api/v1/troubleshoot' from origin 'http://redacted.domain.com:19999' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
2533.3deedd88096cdb65edc8.js:2 
        
        
       POST https://app.netdata.cloud/api/v1/troubleshoot net::ERR_FAILED 401 (Unauthorized)
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
xhr @ 2533.3deedd88096cdb65edc8.js:2
At @ 2533.3deedd88096cdb65edc8.js:2
request @ 2533.3deedd88096cdb65edc8.js:2
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
f.validateStatus @ app.ac7dc8d98b5fc964d88d.js:1
(anonymous) @ app.ac7dc8d98b5fc964d88d.js:1
(anonymous) @ app.ac7dc8d98b5fc964d88d.js:1
space @ 4814.06fb5b81505c874bd186.chunk.js:1
(anonymous) @ 4814.06fb5b81505c874bd186.chunk.js:1
s @ 6187.5b82d99cf6ee4dd956c0.js:2
w @ 6187.5b82d99cf6ee4dd956c0.js:2
T @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
V @ 6187.5b82d99cf6ee4dd956c0.js:2
getNodeLoadable @ 6187.5b82d99cf6ee4dd956c0.js:2
getRecoilValueAsLoadable @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
useSyncExternalStore @ npm.react.dom.804be73a96f176386b4a.js:2
t.useSyncExternalStore @ 6187.5b82d99cf6ee4dd956c0.js:2
Do @ 6187.5b82d99cf6ee4dd956c0.js:2
Bo @ 6187.5b82d99cf6ee4dd956c0.js:2
u @ 4814.06fb5b81505c874bd186.chunk.js:1
P @ 4814.06fb5b81505c874bd186.chunk.js:1
Eo @ npm.react.dom.804be73a96f176386b4a.js:2
Ei @ npm.react.dom.804be73a96f176386b4a.js:2
ks @ npm.react.dom.804be73a96f176386b4a.js:2
ys @ npm.react.dom.804be73a96f176386b4a.js:2
vs @ npm.react.dom.804be73a96f176386b4a.js:2
ss @ npm.react.dom.804be73a96f176386b4a.js:2
Hl @ npm.react.dom.804be73a96f176386b4a.js:2
(anonymous) @ npm.react.dom.804be73a96f176386b4a.js:2
alerts#metrics_correlation=false&after=1699754091000&before=1699755203000&utc=America%2FToronto&offset=-5&timezoneName=Eastern%20Time%20(US%20&modal=alertDetailsModal&modalTab=&modalParams=alertId%3Dfdf77174-12e2-4a01-8718-8b14af33b956&selectedIntegrationCategory=deploy.operating-systems&force_play=false&local--chartName-val=menu_system&local-nodesView-nodeIdToGo-val=menu_Live&local--sidebarOpen-bool=true&local-overview-sidebarTab-val=chartIndexing&local-2906f1ac-7ff4-11ee-a8dc-ca68892189e7-chartName-val=menu_systemd_submenu_cpu:1 Access to XMLHttpRequest at 'https://app.netdata.cloud/api/v1/troubleshoot' from origin 'http://redacted.domain.com:19999' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
2533.3deedd88096cdb65edc8.js:2 
        
        
       POST https://app.netdata.cloud/api/v1/troubleshoot net::ERR_FAILED 401 (Unauthorized)
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
xhr @ 2533.3deedd88096cdb65edc8.js:2
At @ 2533.3deedd88096cdb65edc8.js:2
request @ 2533.3deedd88096cdb65edc8.js:2
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
(anonymous) @ 2533.3deedd88096cdb65edc8.js:2
f.validateStatus @ app.ac7dc8d98b5fc964d88d.js:1
(anonymous) @ app.ac7dc8d98b5fc964d88d.js:1
(anonymous) @ app.ac7dc8d98b5fc964d88d.js:1
space @ 4814.06fb5b81505c874bd186.chunk.js:1
(anonymous) @ 4814.06fb5b81505c874bd186.chunk.js:1
s @ 6187.5b82d99cf6ee4dd956c0.js:2
w @ 6187.5b82d99cf6ee4dd956c0.js:2
T @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
V @ 6187.5b82d99cf6ee4dd956c0.js:2
getNodeLoadable @ 6187.5b82d99cf6ee4dd956c0.js:2
getRecoilValueAsLoadable @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
(anonymous) @ 6187.5b82d99cf6ee4dd956c0.js:2
useSyncExternalStore @ npm.react.dom.804be73a96f176386b4a.js:2
t.useSyncExternalStore @ 6187.5b82d99cf6ee4dd956c0.js:2
Do @ 6187.5b82d99cf6ee4dd956c0.js:2
Bo @ 6187.5b82d99cf6ee4dd956c0.js:2
u @ 4814.06fb5b81505c874bd186.chunk.js:1
P @ 4814.06fb5b81505c874bd186.chunk.js:1
Eo @ npm.react.dom.804be73a96f176386b4a.js:2
Ei @ npm.react.dom.804be73a96f176386b4a.js:2
ks @ npm.react.dom.804be73a96f176386b4a.js:2
ys @ npm.react.dom.804be73a96f176386b4a.js:2
vs @ npm.react.dom.804be73a96f176386b4a.js:2
ss @ npm.react.dom.804be73a96f176386b4a.js:2
Hl @ npm.react.dom.804be73a96f176386b4a.js:2
(anonymous) @ npm.react.dom.804be73a96f176386b4a.js:2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.