感谢 Aubrey、topological 和 FlyingCat 的报告。我们已在 Discourse core 中撤销了该提交。
cvx 确定了问题的根源,并在上游 mail gem 上提出了一个问题:
一旦解决,我们将再次切换回官方 gem。
感谢 Aubrey、topological 和 FlyingCat 的报告。我们已在 Discourse core 中撤销了该提交。
cvx 确定了问题的根源,并在上游 mail gem 上提出了一个问题:
一旦解决,我们将再次切换回官方 gem。
我在 d/boot_dev --init 时遇到另一个错误。这是在一个全新安装的 Ubuntu 22.04 上,并遵循 OP 中的指南。
编辑:已解决——它非常不喜欢以 root 身份运行。请确保您从一开始就以普通用户身份运行。
# d/boot_dev --init
Using source in: /root/dev/discourse
Using data in: /root/dev/discourse/data/postgres
release: Pulling from discourse/discourse_dev
214ca5fb9032: Pull complete
37cd9d4cd9e6: Pull complete
9b38588fc778: Pull complete
cb13139046fe: Pull complete
1243de3fe752: Pull complete
ec3e5331f9b3: Pull complete
0fab0821518d: Pull complete
9b5e686bba91: Pull complete
428573951790: Pull complete
38013f421bac: Pull complete
733b166992df: Pull complete
1fb3d7e57e63: Pull complete
f76a1270a527: Pull complete
133993b18ebe: Pull complete
226b3b82cab1: Pull complete
Digest: sha256:0a08c79cd8997e3bfac037625f2f5b2f26a64564113116b8c18969484b00a8ce
Status: Downloaded newer image for discourse/discourse_dev:release
docker.io/discourse/discourse_dev:release
439f53088cc4aab844a8864b779056a576c731ba4723d4cf8b23d0e97c8ae79c
Installing gems...
^TFollowing files may not be writable, so sudo is needed:
/usr/local/bin
/usr/local/lib/ruby/gems/2.7.0
/usr/local/lib/ruby/gems/2.7.0/build_info
/usr/local/lib/ruby/gems/2.7.0/cache
/usr/local/lib/ruby/gems/2.7.0/doc
/usr/local/lib/ruby/gems/2.7.0/extensions
/usr/local/lib/ruby/gems/2.7.0/gems
/usr/local/lib/ruby/gems/2.7.0/plugins
/usr/local/lib/ruby/gems/2.7.0/specifications
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using i18n 1.10.0
Using minitest 5.15.0
Using tzinfo 2.0.4
Using activesupport 7.0.3
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.6.0
Using nokogiri 1.13.6 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.18.0
Using rails-html-sanitizer 1.4.2
Using actionview 7.0.3
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 7.0.3
Using globalid 1.0.0
Using activejob 7.0.3
Using mini_mime 1.1.2
Using mail 2.8.0.edge from https://github.com/discourse/mail.git
Using digest 3.1.0
Using timeout 0.2.0
Using net-protocol 0.1.3
Using strscan 3.0.3
Using net-imap 0.2.3
Using net-pop 0.1.1
Using net-smtp 0.3.1
Using actionmailer 7.0.3
Using actionview_precompiler 0.2.3
Using activemodel 7.0.3
Using active_model_serializers 0.8.4
Using activerecord 7.0.3
Using public_suffix 4.0.7
Using addressable 2.8.0
Using annotate 3.2.0
Using ast 2.4.2
Using aws-eventstream 1.2.0
Using aws-partitions 1.583.0
Using aws-sigv4 1.5.0
Using jmespath 1.6.1
Using aws-sdk-core 3.130.2
Using aws-sdk-kms 1.56.0
Using aws-sdk-s3 1.114.0
Using aws-sdk-sns 1.53.0
Using ember-source 2.18.2
Using execjs 2.8.1
Using barber 0.12.2
Using coderay 1.1.3
Using better_errors 2.9.1
Using debug_inspector 1.1.0
Using binding_of_caller 1.0.0
Using msgpack 1.5.1
Using bootsnap 1.11.1
Using uniform_notifier 1.16.0
Using bullet 7.0.1
Using bundler 2.3.13
Using byebug 11.1.3
Using cbor 0.5.9.6
Using certified 1.0.0
Using chunky_png 1.4.0
Using colored2 3.1.2
Using connection_pool 2.2.5
Using ipaddr 1.2.4
Using openssl 2.2.1
Using openssl-signature_algorithm 1.1.1
Using cose 1.2.0
Using cppjieba_rb 0.4.2
Using rexml 3.2.5
Using crack 0.4.5
Using css_parser 1.11.0
Using diff-lcs 1.5.0
Using diffy 3.4.0
Using ember-data-source 3.0.2
Using sprockets 3.7.2
Using ember-handlebars-template 0.8.0
Using method_source 1.0.0
Using thor 1.2.1
Using zeitwerk 2.5.4
Using railties 7.0.3
Using jquery-rails 4.4.0
Using discourse-ember-rails 0.18.6
Using discourse-ember-source 3.12.2.3
Using discourse-fonts 0.0.9
Using faker 2.21.0
Using literate_randomizer 0.4.0
Using discourse_dev_assets 0.0.4
Using docile 1.4.0
Using regexp_parser 2.4.0
Using ecma-re-validator 0.4.0
Using email_reply_trimmer 0.1.13
Using excon 0.92.3
Using exifr 1.3.9
Using fabrication 2.28.0
Using fakeweb 1.3.0
Using faraday-em_http 1.0.0
Using faraday-em_synchrony 1.0.0
Using faraday-excon 1.1.0
Using faraday-httpclient 1.0.1
Using multipart-post 2.1.1
Using faraday-multipart 1.0.3
Using faraday-net_http 1.0.1
Using faraday-net_http_persistent 1.2.0
Using faraday-patron 1.0.0
Using faraday-rack 1.0.0
Using faraday-retry 1.0.3
Using ruby2_keywords 0.0.5
Using faraday 1.10.0
Using fast_blank 1.0.1
Using fast_xs 0.8.0
Using fastimage 2.2.6
Using ffi 1.15.5
Using fspath 3.1.2
Using gc_tracer 1.5.1
Using guess_html_encoding 0.0.11
Using hana 1.3.7
Using hashdiff 1.0.1
Using hashie 5.0.0
Using highline 2.0.3
Using hkdf 0.3.0
Using htmlentities 4.3.4
Using http_accept_language 2.1.1
Using image_size 3.0.1
Using in_threads 1.6.0
Using progress 3.6.0
Using image_optim 0.31.1
Using json 2.6.1
Using json-schema 2.8.1
Using uri_template 0.7.0
Using json_schemer 0.2.21
Using jwt 2.3.0
Using kgio 2.11.4
Using libv8-node 16.10.0.0 (x86_64-linux)
Using rb-fsevent 0.11.1
Using rb-inotify 0.10.1
Using listen 3.7.1
Using request_store 1.5.1
Using lograge 0.12.0
Using logstash-event 1.2.02
Using logstash-logger 0.26.1
Using logster 2.11.2
Using lru_redux 1.1.0
Using lz4-ruby 0.3.3
Using maxminddb 0.1.22
Using memory_profiler 1.0.0
Using message_bus 4.2.0
Using mini_racer 0.6.2
Using redis 4.5.1
Using sidekiq 6.4.2
Using mini_scheduler 0.13.0
Using mini_sql 1.4.0
Using mini_suffix 0.3.3
Using mocha 1.14.0
Using multi_json 1.15.0
Using multi_xml 0.6.0
Using mustache 1.1.1
Using uri 0.11.0
Using net-http 0.2.2
Using nio4r 2.5.8
Using oauth 0.5.10
Using oauth2 1.4.7
Using oj 3.13.11
Using omniauth 1.9.1
Using omniauth-oauth2 1.7.2
Using omniauth-facebook 9.0.0
Using omniauth-github 1.4.0
Using omniauth-google-oauth2 0.8.2
Using omniauth-oauth 1.2.0
Using omniauth-twitter 1.4.0
Using optimist 3.0.1
Using parallel 1.22.1
Using parallel_tests 3.8.1
Using parser 3.1.2.0
Using pg 1.3.5
Using pry 0.13.1
Using pry-byebug 3.9.0
Using pry-rails 0.3.9
Using puma 5.6.4
Using r2 0.2.7
Using rack-mini-profiler 3.0.0
Using rack-protection 2.2.0
Using rails_failover 0.8.1
Using rails_multisite 4.0.1
Using rainbow 3.1.1
Using raindrops 0.20.0
Using rbtrace 0.4.14
Using rchardet 1.8.0
Using redis-namespace 1.8.2
Using rinku 2.0.6
Using rotp 6.2.0
Using rqrcode_core 1.2.0
Using rqrcode 2.1.1
Using rspec-support 3.11.0
Using rspec-core 3.11.0
Using rspec-expectations 3.11.0
Using rspec-mocks 3.11.1
Using rspec 3.11.0
Using rspec-html-matchers 0.9.4
Using rspec-rails 5.1.2
Using rss 0.2.9
Using rswag-specs 2.5.1
Using rubocop-ast 1.18.0
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Using rubocop 1.29.1
Using rubocop-rspec 2.10.0
Using rubocop-discourse 2.5.0
Using ruby-prof 1.4.3
Using ruby-readability 0.7.0
Using rubyzip 2.3.2
Using sanitize 6.0.0
Using sassc 2.0.1
Using sprockets-rails 3.4.2
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using seed-fu 2.3.9
Using shoulda-matchers 5.1.0
Using simplecov-html 0.12.3
Using simplecov_json_formatter 0.1.4
Using simplecov 0.21.2
Using sshkey 2.0.0
Using stackprof 0.2.19
Using test-prof 1.0.9
Using uglifier 4.2.0
Using unf_ext 0.0.8.1
Using unf 0.1.4
Using unicorn 6.1.0
Using webmock 3.14.0
Using webpush 1.1.0
Using xorcist 1.1.2
Using yaml-lint 0.0.10
Bundle complete! 126 Gemfile dependencies, 232 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
1 installed gem you directly depend on is looking for funding.
Run `bundle fund` for details
Migrating database...
rake aborted!
Errno::EACCES: Permission denied @ dir_s_mkdir - /src/app/assets/javascripts/plugins
/src/lib/plugin/instance.rb:449:in `ensure_directory'
/src/lib/plugin/instance.rb:721:in `activate!'
/src/lib/discourse.rb:279:in `block in activate_plugins!'
/src/lib/discourse.rb:276:in `each'
/src/lib/discourse.rb:276:in `activate_plugins!'
/src/config/application.rb:222:in `block in <class:Application>'
/src/lib/plugin.rb:6:in `initialization_guard'
/src/config/application.rb:221:in `<class:Application>'
/src/config/application.rb:81:in `<module:Discourse>'
/src/config/application.rb:80:in `<main>'
/src/Rakefile:7:in `<main>'
(See full trace by running task with --trace)
# d/rails s
Traceback (most recent call last):
8: from /src/bin/unicorn:70:in `<main>'
7: from /src/bin/unicorn:38:in `ensure_cache_clean!'
6: from /usr/local/lib/ruby/2.7.0/fileutils.rb:211:in `mkdir_p'
5: from /usr/local/lib/ruby/2.7.0/fileutils.rb:211:in `each'
4: from /usr/local/lib/ruby/2.7.0/fileutils.rb:226:in `block in mkdir_p'
3: from /usr/local/lib/ruby/2.7.0/fileutils.rb:226:in `reverse_each'
2: from /usr/local/lib/ruby/2.7.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
1: from /usr/local/lib/ruby/2.7.0/fileutils.rb:250:in `fu_mkdir'
/usr/local/lib/ruby/2.7.0/fileutils.rb:250:in `mkdir': Permission denied @ dir_s_mkdir - /src/tmp (Errno::EACCES)
cors_origin 设置无效。Access-Control-Allow-Origin 标头未出现。enable_cors 设置在开发模式下被忽略了。
因此,CORS 中间件从未安装。我只是在我本地的 discourse 仓库中删除了 if 语句,这样中间件在任何情况下都会被安装。
也许一位开发者(或者本指南的作者 @rishabh?)能帮我解决这个问题。我严格按照 OP 指南操作,在一个新的虚拟机上安装了 Ubuntu 22.04,并使用了一个普通用户(非 root)账户。
将插件符号链接到 discourse/plugins/ 子文件夹,除非我执行 d/shutdown_dev; d/boot_dev,否则看不到插件初始化 JS 代码的更改,尽管我重启了 d/rails s 和 d/ember-cli。
将插件复制到 discourse/plugins/ 子文件夹,可以看到插件初始化 JS 代码的更改,而无需执行 d/shutdown_dev; d/boot_dev,只需重启 d/rails s 和 d/ember-cli。
所讨论的插件是 discourse-math,我正在更改的代码位于 assets/initializers/javascript/*.js。我注意到这些文件是侧载的,并且浏览器不会直接通过 HTTP GET 调用它们(不确定这是否有区别)。
附注:我刚开始接触 Discourse,但对 Web/JS 开发并不陌生(换句话说,不用问我是否刷新了浏览器
)。
能否请开发者检查此错误?它似乎与 Ruby 相关,而不是我个人的情况。我正在按照 Docker 安装的说明在 Windows 上安装 Discourse for Development,并且以前已成功执行过几次。脚本进行到数据库安装时失败了。第一个警告看起来并不致命,但在转储文件下方有一个丢失的 xss.min.js 文件,这是致命的:
‘’'您正在尝试在测试环境中运行迁移,并且没有加载插件,请设置 LOAD_PLUGINS 为 1
DEPRECATION WARNING:使用旧版连接处理已弃用。请在您的应用程序中将 legacy_connection_handling 设置为 false。
新的连接处理不支持 connection_handlers getter 和 setter。
阅读有关如何迁移的更多信息:Multiple Databases with Active Record — Ruby on Rails Guides (在 /src/config/environment.rb:7 的 中调用)
== 20150501152228 RenameTotalVotesToVoters: 正在迁移 =========
== 20150501152228 RenameTotalVotesToVoters: 已迁移 (0.0106s) ===============
== 20151016163051 MergePollsVotes: 正在迁移 =================================
== 20151016163051 MergePollsVotes: 已迁移 (0.0017s) =========================
== 20160321164925 ClosePollsInClosedTopics: 正在迁移 =========================
== 20160321164925 ClosePollsInClosedTopics: 已迁移 (0.0281s) ===============
== 20180820073549 CreatePollsTables: 正在迁移 ================================
– create_table(:polls, {})
→ 0.0067s
– add_index(:polls, [:post_id, :name], {:unique=>true})
→ 0.0008s
– create_table(:poll_options, {})
→ 0.0039s
– add_index(:poll_options, [:poll_id, :digest], {:unique=>true})
→ 0.0009s
– create_table(:poll_votes, {:id=>false})
→ 0.0044s
– add_index(:poll_votes, [:poll_id, :poll_option_id, :user_id], {:unique=>true})
→ 0.0006s
== 20180820073549 CreatePollsTables: 已迁移 (0.0188s) =======================
== 20180820080623 MigratePollsData: 正在迁移 =================================
– execute(“INSERT INTO post_custom_fields (name, value, post_id, created_at, updated_at)\nSELECT ‘has_polls’, ‘t’, post_id, MIN(created_at), MIN(updated_at)\n FROM polls\n GROUP BY post_id\n”)
→ 0.0008s
== 20180820080623 MigratePollsData: 已迁移 (0.0033s) ========================
== 20191114160613 AddGraphToPolls: 正在迁移 ==================================
– add_column(:polls, :chart_type, :integer, {:default=>0, :null=>false})
→ 0.0012s
== 20191114160613 AddGraphToPolls: 已迁移 (0.0020s) =========================
== 20191206123012 AddGroupNameToPolls: 正在迁移 ==============================
– add_column(:polls, :groups, :string, {})
→ 0.0005s
== 20191206123012 AddGroupNameToPolls: 已迁移 (0.0012s) =====================
== 20200520015508 ClearLastGravatarDownloadAttemptOnUserAvatars: 正在迁移 ====
– execute(“UPDATE user_avatars\nSET last_gravatar_download_attempt = null\nWHERE user_id = -2 AND custom_upload_id IS NULL AND gravatar_upload_id IS NULL\n”)
→ 0.0006s
== 20200520015508 ClearLastGravatarDownloadAttemptOnUserAvatars: 已迁移 (0.0014s)
== 20200804144550 AddTitleToPolls: 正在迁移 ==================================
– add_column(:polls, :title, :string, {})
→ 0.0005s
== 20200804144550 AddTitleToPolls: 已迁移 (0.0011s) =========================
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /src/app/assets/javascripts/node_modules/xss/dist/xss.min.js
/src/lib/pretty_text.rb:613:in block in ctx_load' /src/lib/pretty_text.rb:612:in each’
/src/lib/pretty_text.rb:612:in ctx_load' /src/lib/pretty_text.rb:108:in create_es6_context’
/src/lib/pretty_text.rb:153:in block in v8' /src/lib/pretty_text.rb:151:in synchronize’
/src/lib/pretty_text.rb:151:in v8' /src/lib/pretty_text.rb:190:in block in markdown’
/src/lib/pretty_text.rb:606:in block in protect' /src/lib/pretty_text.rb:605:in synchronize’
/src/lib/pretty_text.rb:605:in protect' /src/lib/pretty_text.rb:189:in markdown’
/src/lib/pretty_text.rb:318:in cook' /src/app/models/user_profile.rb:149:in cooked’
/src/app/models/user_profile.rb:158:in cook' (eval):51:in block (2 levels) in run_file’
/src/lib/tasks/db.rake:234:in block (2 levels) in <main>' /src/lib/distributed_mutex.rb:57:in block in synchronize’
/src/lib/distributed_mutex.rb:53:in synchronize' /src/lib/distributed_mutex.rb:53:in synchronize’
/src/lib/distributed_mutex.rb:38:in synchronize' /src/lib/tasks/db.rake:214:in block in ’
Tasks: TOP => db:migrate
(运行任务时显示 --trace 可查看完整跟踪)‘’’
非常感谢您提供的这个很棒的资源。有几点可以帮助您:
这是完全删除和重启数据的命令:
docker stop discourse_dev ; docker rm discourse_dev ; sudo rm -rf data ; rm -rf tmp/*
如果您遇到上述之类的迁移问题,请确保您具有正确的权限。您必须属于 docker 组或 sudo(不推荐的第二种选择)。
在启动 d/ember-cli 之前,请让 d/rails s 完成,否则会出现一些奇怪的问题。
谢谢你,Tarek。
在擦除安装并重复克隆过程后,初始化过程中出现了完全相同的错误,即:
“rake aborted!
”Errno::ENOENT: No such file or directory @ rb_sysopen”
但这次我能够成功继续,并看到了“Congratulations.”。谢谢。
现在,由于脚本提前终止,没有开发管理员电子邮件,也没有配置文件。如果有人能找出初始化问题就好了。
我使用命令“d/rake admin:create”配置了一个管理员电子邮件,并输入了一个有效的电子邮件和(至少 10 个字符)密码。
然后,我按照指示在浏览器中成功启动了 Discourse。
有人在使用 Fedora 吗?这增加了一些复杂性,因为 Podman 和 SELinux 用于增强安全性。Podman 应该不是什么大问题,它是 OCI 兼容的,并且安装了 podman-docker,所有 Docker 命令都会被翻译成 Podman 命令。对于 SELinux,我认为我也找到了正确的解决方法,但仍然遇到了一个问题。
因此,在 discourse 目录下,我运行此命令 mkdir -vp data/postgres; sudo semanage fcontext -a -t svirt_sandbox_file_t \"/home/user/discourse/data(/.*)?\" \u0026\u0026 restorecon -rv . 来应用一个我认为足够(至少 SELinux 错误消失了)的 SELinux 上下文标签。
但是之后我仍然遇到这个错误:
[user@fedora discourse]$ d/boot_dev --init
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: template: info:1:2: executing "info" at <.Architecture>: can't evaluate field Architecture in type *define.Info
WARNING: Docker architecture is not x86_64.
Discourse development is unlikely to work using Docker's architecture emulation.
Please try a native development installation.
Using source in: /home/user/discourse
Using data in: /home/user/discourse/data/postgres
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
✔ docker.io/discourse/discourse_dev:release
Trying to pull docker.io/discourse/discourse_dev:release...
Getting image source signatures
Copying blob b42e9bacf67a done
Copying blob 3257b89dc3e0 done
Copying blob 8f87c7014fb0 done
Copying blob bf00c24d0f5b done
Copying blob 10e0cd28eb63 done
Copying blob 1efc276f4ff9 done
Copying blob 6d9350d0e59c done
Copying blob 84ee3423e706 done
Copying blob ee2701209d47 done
Copying blob ce48a2c1c5d3 done
Copying blob 2f702c3c2f9f done
Copying blob 27762615d0fc done
Copying blob 7056a5796a1a done
Copying blob c8a22dd30e4c done
Copying blob 1a93cd2f0c23 done
Copying config 6365e737b9 done
Writing manifest to image destination
Storing signatures
6365e737b90aea36af1fd9ed029db43a0a620f1c285416546f5e6ee728aca4c5
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7
Installing gems...
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Could not locate Gemfile
systemd journal 报告了以下信息:
Aug 09 18:47:45 fedora podman[19380]: 2022-08-09 18:47:45.841001786 +0200 CEST m=+0.137712533 image pull discourse/discourse_dev:release
Aug 09 18:47:45 fedora podman[19380]:
Aug 09 18:47:46 fedora podman[19380]: 2022-08-09 18:47:46.043506861 +0200 CEST m=+0.340217585 container create 5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7 (image=docker.io/discourse/discourse_dev:release, name=discourse_dev)
Aug 09 18:47:46 fedora kernel: tun: Universal TUN/TAP device driver, 1.6
Aug 09 18:47:46 fedora systemd[1684]: selinux: avc: op=load_policy lsm=selinux seqno=7 res=1
Aug 09 18:47:46 fedora systemd[1684]: selinux: Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.40 2022-04-14
Aug 09 18:47:46 fedora systemd[1684]: selinux: Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.40 2022-04-14
Aug 09 18:47:46 fedora systemd[1684]: selinux: Regex version mismatch, expected: 10.39 2021-10-29 actual: 10.40 2022-04-14
Aug 09 18:47:46 fedora systemd[1684]: Started libpod-conmon-5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7.scope.
Aug 09 18:47:46 fedora systemd[1684]: Started libpod-5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7.scope - libcrun container.
Aug 09 18:47:46 fedora chronyd[792]: Selected source 158.101.221.122 (2.fedora.pool.ntp.org)
Aug 09 18:47:46 fedora podman[19380]: 2022-08-09 18:47:46.370028125 +0200 CEST m=+0.666738859 container init 5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7 (image=docker.io/discourse/discourse_dev:release, name=discourse_dev)
Aug 09 18:47:46 fedora podman[19380]: 2022-08-09 18:47:46.433863112 +0200 CEST m=+0.730573845 container start 5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7 (image=docker.io/discourse/discourse_dev:release, name=discourse_dev)
Aug 09 18:47:46 fedora discourse_dev[19420]: run-parts: executing /etc/runit/1.d/00-fix-var-logs
Aug 09 18:47:46 fedora discourse_dev[19420]: run-parts: executing /etc/runit/1.d/anacron
Aug 09 18:47:46 fedora discourse_dev[19420]: run-parts: executing /etc/runit/1.d/cleanup-pids
Aug 09 18:47:46 fedora discourse_dev[19420]: Cleaning stale PID files
Aug 09 18:47:46 fedora discourse_dev[19420]: run-parts: executing /etc/runit/1.d/ensure-database
Aug 09 18:47:47 fedora podman[19425]: 2022-08-09 18:47:47.698175757 +0200 CEST m=+1.211177315 container exec 5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7 (image=docker.io/discourse/discourse_dev:release, name=discourse_dev)
Aug 09 18:47:48 fedora discourse_dev[19420]: Started runsvdir, PID is 29
Aug 09 18:47:48 fedora podman[19425]: 2022-08-09 18:47:48.535303673 +0200 CEST m=+2.048305123 container exec_died 5282393e248e33800e235b4405c9a7197d10a3fc1d405450f1c99d2a5c7c85c7 (image=docker.io/discourse/discourse_dev:release, name=discourse_dev, execID=166d86f7ca8739899bd59801c2f8bb3d9b940329d8e6bb29d0f45ad82e9d60b0)
discourse 目录下的 log 目录是空的,我该如何更好地进行故障排除?
路径似乎已正确设置以查找 Gem 文件。
[user@fedora discourse]$ SCRIPTPATH=$(cd "$(dirname "$0")" > /dev/null; pwd -P)
[user@fedora discourse]$ echo $SCRIPTPATH
/home/user/discourse
很久以前,我曾成功地从头开始构建了一个虚拟 Fedora 开发环境,但无法让生产环境正常工作。我还询问了 Podman Q,有人好心回复说这是可能的,但有很多东西需要更改,而他没有时间去做。
我很想让开发版和生产版的 Fedora 版本都能运行。 .
我不明白这个问题。它以这个错误中止:
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /src/app/assets/javascripts/node_modules/xss/dist/xss.min.js
/src/lib/pretty_text.rb:613:in `block in ctx_load'
/src/lib/pretty_text.rb:612:in `each'
/src/lib/pretty_text.rb:612:in `ctx_load'
/src/lib/pretty_text.rb:108:in `create_es6_context'
/src/lib/pretty_text.rb:153:in `block in v8'
/src/lib/pretty_text.rb:151:in `synchronize'
/src/lib/pretty_text.rb:151:in `v8'
/src/lib/pretty_text.rb:190:in `block in markdown'
/src/lib/pretty_text.rb:606:in `block in protect'
/src/lib/pretty_text.rb:605:in `synchronize'
/src/lib/pretty_text.rb:605:in `protect'
/src/lib/pretty_text.rb:189:in `markdown'
/src/lib/pretty_text.rb:318:in `cook'
/src/app/models/user_profile.rb:149:in `cooked'
/src/app/models/user_profile.rb:158:in `cook'
(eval):51:in `block (2 levels) in run_file'
/src/lib/tasks/db.rake:234:in `block (2 levels) in <main>'
/src/lib/distributed_mutex.rb:57:in `block in synchronize'
/src/lib/distributed_mutex.rb:53:in `synchronize'
/src/lib/distributed_mutex.rb:53:in `synchronize'
/src/lib/distributed_mutex.rb:38:in `synchronize'
/src/lib/tasks/db.rake:214:in `block in <main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我想使用 Ubuntu,但不知何故它与 spice-vdagent 工作不佳,运行虚拟机时出现许多图形错误。Fedora 工作起来像黄油一样流畅……我以为容器解决了可移植性问题
我猜我只能设置一个无头 Ubuntu 系统并通过 SSH 登录。
我在 Ubuntu Server 22.04 中遇到同样的错误。
我也有这个问题。遵循了@tarek的建议并仔细检查了。问题仍然存在。我还清理了整个discourse目录并从头开始。在虚拟机中使用Ubuntu 22.04.01,并使用Ubuntu可用的最新Docker。
截至当前的 git master,这不会成功完成。我认为这是核心中的一个错误。要设置并运行开发环境,请在出现错误后执行以下操作:
d/rake db:migrate
d/rake admin:create
d/rails s
另外在接下来的两个终端中,输入 d/ember-cli 和 d/mailhog。
有什么办法可以阻止 d/rails s 显示所有查询输出吗?这让我很难使用 byebug 等工具来找出我遇到的错误。
尝试: DISCOURSE_DEV_LOG_LEVEL=info bin/rails s
更多提示: https://discourse.pluginmanager.org/t/debugging-ruby-with-byebug/378?u=merefield
你好,
我正在 Ubuntu 的稳定版(v2.8.8)上尝试运行此程序,并遇到了以下错误:
Migrating database...
== 20220104053343 AddBookmarkPolymorphicColumns: migrating ====================
-- add_column(:bookmarks, :bookmarkable_id, :integer)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists
/src/lib/migration/safe_migrate.rb:92:in `async_exec'
/src/db/migrate/20220104053343_add_bookmark_polymorphic_columns.rb:5:in `change'
/src/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
/src/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/src/lib/migration/safe_migrate.rb:28:in `migrate'
/src/lib/migration/safe_migrate.rb:55:in `migrate'
/src/lib/tasks/db.rake:218:in `block (2 levels) in <main>'
/src/lib/distributed_mutex.rb:33:in `block in synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:14:in `synchronize'
/src/lib/tasks/db.rake:210:in `block in <main>'
Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists
/src/lib/migration/safe_migrate.rb:92:in `async_exec'
/src/db/migrate/20220104053343_add_bookmark_polymorphic_columns.rb:5:in `change'
/src/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
/src/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/src/lib/migration/safe_migrate.rb:28:in `migrate'
/src/lib/migration/safe_migrate.rb:55:in `migrate'
/src/lib/tasks/db.rake:218:in `block (2 levels) in <main>'
/src/lib/distributed_mutex.rb:33:in `block in synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:14:in `synchronize'
/src/lib/tasks/db.rake:210:in `block in <main>'
Caused by:
PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exists
/src/lib/migration/safe_migrate.rb:92:in `async_exec'
/src/db/migrate/20220104053343_add_bookmark_polymorphic_columns.rb:5:in `change'
/src/lib/freedom_patches/schema_migration_details.rb:9:in `block in exec_migration'
/src/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/src/lib/migration/safe_migrate.rb:28:in `migrate'
/src/lib/migration/safe_migrate.rb:55:in `migrate'
/src/lib/tasks/db.rake:218:in `block (2 levels) in <main>'
/src/lib/distributed_mutex.rb:33:in `block in synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:29:in `synchronize'
/src/lib/distributed_mutex.rb:14:in `synchronize'
/src/lib/tasks/db.rake:210:in `block in <main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我尝试运行:
d/rake db:migrate RAILS_ENV=development
但仍然出现相同的错误。有人遇到过这种情况吗?
我怀疑你正在使用和以前一样的数据库,所以它已经迁移过了?
实际上 @hyphalos 我收回之前的话,我可以在容器内使用以下 shell 命令重现此问题:
discourse@discourse:/src$ sudo su postgres -c 'psql discourse -c \"drop database discourse_test\"'
DROP DATABASE
discourse@discourse:/src$ sudo su postgres -c 'psql discourse -c \"create database discourse_test\"'
CREATE DATABASE
discourse@discourse:/src$ sudo su postgres -c 'psql -c \"grant all privileges on database discourse_test to discourse;\"'
GRANT
discourse@discourse:/src$ RAILS_ENV=test rake db:migrate
这里是不是有什么不对劲?
看起来这个迁移可能会有问题?:
== 20220104053343 AddBookmarkPolymorphicColumns: migrating ====================
-- add_column(:bookmarks, :bookmarkable_id, :integer)
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::DuplicateColumn: ERROR: column "bookmarkable_id" of relation "bookmarks" already exist
这很奇怪(?),因为:
discourse_test=> \d bookmarks
Table "public.bookmarks"
Column | Type | Collation | Nullable | Default
----------------+--------------------------------+-----------+----------+---------------------------------------
id | bigint | | not null | nextval('bookmarks_id_seq'::regclass)
user_id | bigint | | not null |
post_id | bigint | | not null |
name | character varying(100) | | |
reminder_at | timestamp without time zone | | |
created_at | timestamp(6) without time zone | | not null |
updated_at | timestamp(6) without time zone | | not null |
reminder_last_sent_at | timestamp without time zone | | |
reminder_set_at | timestamp without time zone | | |
auto_delete_preference | integer | | not null | 0
pinned | boolean | | | false
for_topic | boolean | | not null | false
Indexes:
"bookmarks_pkey" PRIMARY KEY, btree (id)
"index_bookmarks_on_post_id" btree (post_id)
"index_bookmarks_on_reminder_at" btree (reminder_at)
"index_bookmarks_on_reminder_set_at" btree (reminder_set_at)
"index_bookmarks_on_user_id" btree (user_id)
"index_bookmarks_on_user_id_and_post_id_and_for_topic" UNIQUE, btree (user_id, post_id, for_topic)
这似乎不会影响 tests-passed,只影响 stable 分支?
感谢 @RGJ,这可能有助于阐明问题:
抄送:@pfaffman
嘿 @Robert,
我以为我疯了,以为只有我遇到了这个问题。我一直在努力寻找解决方法。我之前有一篇帖子,在那里我找到了书签问题的解决方法,但又遇到了另一个问题:
有人能给我指明正确的方向来解决这个问题吗?
运行 d/boot_dev --init 时出现此问题
rake 中止!
ActiveRecord::ConnectionNotEstablished: 连接到服务器“127.0.0.1”,端口 5432 失败:连接被拒绝
服务器是否在该主机上运行并接受 TCP/IP 连接?
连接到服务器“::1”,端口 5432 失败:无法分配请求的地址
服务器是否在该主机上运行并接受 TCP/IP 连接?
/src/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/src/config/environment.rb:7:in `<main>'
原因:
PG::ConnectionBad: 连接到服务器“127.0.0.1”,端口 5432 失败:连接被拒绝
服务器是否在该主机上运行并接受 TCP/IP 连接?
连接到服务器“::1”,端口 5432 失败:无法分配请求的地址
服务器是否在该主机上运行并接受 TCP/IP 连接?
/src/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/src/config/environment.rb:7:in `<main>'
任务:TOP => db:migrate => db:load_config => environment
(通过运行带 --trace 的任务查看完整跟踪)
提前感谢所有帮助 ![]()
运行 d/boot_dev --init 时遇到以下错误:
...
...
...
== 20221219082223 AddIndexToChatMessages: migrated (0.0138s) ==
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /src/app/assets/javascripts//node_modules/loader.js/dist/loader/loader.js
/src/lib/pretty_text.rb:637:in `block in ctx_load'
/src/lib/pretty_text.rb:636:in `each'
/src/lib/pretty_text.rb:636:in `ctx_load'
/src/lib/pretty_text.rb:97:in `create_es6_context'
/src/lib/pretty_text.rb:144:in `block in v8'
/src/lib/pretty_text.rb:142:in `synchronize'
/src/lib/pretty_text.rb:142:in `v8'
/src/lib/pretty_text.rb:184:in `block in markdown'
/src/lib/pretty_text.rb:630:in `block in protect'
/src/lib/pretty_text.rb:629:in `synchronize'
/src/lib/pretty_text.rb:629:in `protect'
/src/lib/pretty_text.rb:183:in `markdown'
/src/lib/pretty_text.rb:328:in `cook'
/src/app/models/user_profile.rb:149:in `cooked'
/src/app/models/user_profile.rb:158:in `cook'
(eval):51:in `block (2 levels) in run_file'
/src/lib/tasks/db.rake:234:in `block (2 levels) in <main>'
/src/lib/distributed_mutex.rb:57:in `block in synchronize'
/src/lib/distributed_mutex.rb:53:in `synchronize'
/src/lib/distributed_mutex.rb:53:in `synchronize'
/src/lib/distributed_mutex.rb:38:in `synchronize'
/src/lib/tasks/db.rake:214:in `block in <main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)