【问题标题】:Accessing Nexus Config - Ext.JSON.decode(): You're trying to decode an invalid JSON String:访问 Nexus 配置 - Ext.JSON.decode():您正在尝试解码无效的 JSON 字符串:
【发布时间】:2019-07-09 13:29:13
【问题描述】:

使用 Sonatype Nexus,我仅在访问 /nexus/#admin/support/status 时收到此错误消息。

Ext.JSON.decode():您正在尝试解码无效的 JSON 字符串:Nexus Repository Manager (new Image).src="http://localhost/nexus/static/rapture/resources/favicon.ico ?_v=3.17.0-01&_e=OSS" function progressMessage(msg) { if (console && console.log) { console.log(msg); } document.getElementById('loading-msg').innerHTML=msg;正在加载 ... progressMessage('正在加载 baseapp-prod.js'); progressMessage('正在加载 extdirect-prod.js'); progressMessage('正在加载 bootstrap.js'); progressMessage('正在加载 d3.v4.min.js'); progressMessage('正在加载 nexus-rapture-prod.js'); progressMessage('正在加载 nexus-blobstore-s3-prod.js'); progressMessage('正在加载 nexus-rutauth-plugin-prod.js'); progressMessage('正在加载 nexus-coreui-plugin-prod.js'); progressMessage('正在加载 nexus-proui-plugin-prod.js'); progressMessage('正在加载 nexus-repository-pypi-prod.js'); progressMessage('正在加载 nexus-repository-maven-prod.js'); progressMessage('正在加载 nexus-repository-npm-prod.js'); progressMessage('正在加载 nexus-onboarding-plugin-prod.js'); progressMessage('正在加载 nexus-repository-nuget-prod.js'); progressMessage('正在加载 nexus-repository-rubygems-prod.js'); progressMessage('正在加载 nexus-repository-docker-prod.js'); progressMessage('正在加载 app.js'); progressMessage('正在初始化...');

我正在使用反向代理 (nginx) 分配 RUT-header 以进行授权,如下所示:

server { 
    listen 80; server_name localhost;

    location /auth { 
        proxy_set_header Host $host; 
        proxy_pass_request_body off; 
        proxy_set_header Content-Length ""; 
        proxy_pass http://nexus-proxy:8080; 
    }

    location /nexus { 
        auth_request /auth; 
        auth_request_set $user $upstream_http_x_forwarded_user;

        proxy_set_header Host $host; 
        proxy_set_header X-Real-IP $remote_addr; 
        proxy_set_header X-Forwarded-For $remote_addr; 
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-User $user; 
        proxy_pass http://nexus:8081; 
    }
}

成功验证后,200 响应代码和 X-Forwarded-User 将发送到 header 和正文中的空 JSON 对象(否则在主页中会抱怨 nexus)。

我想知道这个空的 JSON 对象是否可能是我在关系状态页面上收到此消息的原因,以及我可以做些什么来避免它。 Nexus Ext js 是否有 JSON-response-body 必须遵循的预定义格式?

【问题讨论】:

    标签: extjs nexus


    【解决方案1】:

    迟到的答案,以防它可能对某人有帮助。

    我发现我的广告拦截器也导致了这个问题

    在我的情况下,我必须禁用我的添加阻止程序 uBlock origin 来修复它

    【讨论】:

    • 谢谢。在我的例子中,它是来自 EasyPrivacy 的 /service/metrics/* 模式。
    【解决方案2】:

    如果其他人有这个问题,它显然与 SSL 有关。当我使用 https 提供页面时,一切正常。

    【讨论】:

      猜你喜欢
      • 2012-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-02
      • 1970-01-01
      • 2021-07-10
      • 1970-01-01
      • 2012-09-12
      相关资源
      最近更新 更多