Javascript 错误 + 更新 2.6.0.beta3 后内容丢失

我正在运行自托管的 Discourse 站点 forum.embeetle.com,并于昨天使用“一键浏览器升级”将其更新到了 2.6.0.beta3 版本。

更新前,论坛运行正常。更新后,论坛不再显示主题内容、包含登录选项的顶部栏以及其他一些网页界面元素。目前首页的显示效果如下:

这看起来像是网页的部分内容无法从服务器获取,或者 JavaScript 代码未能运行。

由于似乎没有人报告类似问题,我推测这可能是我特定环境设置导致的问题,但我不清楚具体原因。非常欢迎任何关于如何排查此情况的建议。

该安装是自托管的,运行在 Docker 中,并通过 Unix socket 与 Docker 外部的 Nginx 服务器通信。此设置已稳定运行了很长时间,我并未对其做任何更改。

Firefox 开发者工具控制台在打开论坛首页后显示了以下错误:

Uncaught TypeError: Discourse.getURL is not a function
    iconTagRenderer 81af47c00866048c45bf30a4543ac68bbfa12b26.js:37
    default _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:24080
    default _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:24150
    a _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:61636
    registerUnbound _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:543
    wrapHelper _vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:1808
    main _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:63114
    i _vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:1591
    s _vendor-a520d2facd37b23a6fce06beaf5feaa3034f761d5b4f37c89c4cecd3ead14192.js:1595
    renderTopicListItem _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:58966
    didReceiveAttrs _application-7cd582275ddbdcd17a8034612cd6e29612ffcd8c00a7b8f2bbf13154b6db1b16.js:58960
    jQuery 30
81af47c00866048c45bf30a4543ac68bbfa12b26.js:37:56
XML Parsing Error: syntax error
Location: https://forum.embeetle.com/logs/report_js_error
Line Number 1, Column 1: report_js_error:1:1

我尝试使用 ./launcher rebuild app 重新构建。虽然进行了一些更新,但问题依然存在。我还尝试了 ./discourse-doctor,一切看起来都正常。请参阅下方的 discourse-doctor 输出。

DISCOURSE DOCTOR Sat Sep 26 12:30:19 CEST 2020
OS: Linux foechoer.sikando.com 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


Found containers/app.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=forum.embeetle.com
SMTP_ADDRESS=smtp.zoho.com #mail.embeetle.com
DEVELOPER_EMAILS=johan@embeetle.com,kristof@embeetle.com,matic@embeetle.com
SMTP_PASSWORD=A3!r1&nR0LuVmdW3Tpwa
SMTP_PORT=587
SMTP_USER_NAME=forum@embedeer.com
LETSENCRYPT_ACCOUNT_EMAIL=postmaster@sikando.com

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 19.03.13, build 4484c46d9d

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS               NAMES
7e92f71e558e        local_discourse/app   "/sbin/boot"        5 minutes ago       Up 4 minutes                            app

7e92f71e558e        local_discourse/app   "/sbin/boot"        5 minutes ago       Up 4 minutes                            app

Discourse container app is running


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-math.git
          - git clone https://github.com/discourse/discourse-bbcode-color.git

No non-official plugins detected.

See https://github.com/discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
Discourse 2.6.0.beta3
Discourse version at forum.embeetle.com: Discourse 2.6.0.beta3 
Discourse version at localhost: NOT FOUND
==================== DNS PROBLEM ====================
This server reports NOT FOUND, but forum.embeetle.com reports Discourse 2.6.0.beta3 .
This suggests that you have a DNS problem or that an intermediate proxy is to blame.
If you are using Cloudflare, or a CDN, it may be improperly configured.


==================== MEMORY INFORMATION ====================
RAM (MB): 20553

              total        used        free      shared  buff/cache   available
Mem:          20071        4405       14260         305        1405       15048
Swap:          2047           0        2047

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
df: /var/discourse: No such file or directory
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       1.4T  1.1T  183G  87% /

==================== DISK INFORMATION ====================
Disk /dev/sda: 1.4 TiB, 1503238553600 bytes, 2936012800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x645c17b2

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sda1  *       2048    1953791    1951744  953M 83 Linux
/dev/sda2       1953792 2936010751 2934056960  1.4T 83 Linux

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) [johan@embeetle.com]: johan@sikanda.be
Sending mail to johan@sikanda.be. . . 
Testing sending to johan@sikanda.be using smtp.zoho.com:587.
SMTP server connection successful.
Sending to johan@sikanda.be. . . 
Mail accepted by SMTP server.

If you do not receive the message, check your SPAM folder
or test again using a service like http://www.mail-tester.com/.

If the message is not delivered it is not a problem with Discourse.

Check the SMTP server logs to see why it failed to deliver the message.
Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD
Replacing: Sending mail to

==================== DONE! ====================

请尝试通过 SSH 从命令行进行升级,看看是否有帮助。

我尝试了:

git pull
./launcher rebuild app

命令行显示一切正常,但浏览器仍显示不完整的页面,并在开发者控制台中出现“Uncaught TypeError: Discourse.getURL is not a function”错误。

1 个赞

这一定来自某个插件或主题组件。请尝试逐个禁用它们,以定位问题来源。

6 个赞

与此相关,请尝试在安全模式下运行,该模式会禁用所有主题。

1 个赞

这意味着您正在使用旧版本的 标签图标组件。请在您的管理面板中更新它。

6 个赞

问题解决了。我的论坛又恢复正常了。

谢谢大家。Discourse 很棒。Meta 社区很棒。你们都很棒。

5 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.