보고해 주셔서 감사합니다 @Aubrey @topological @FlyingCat. 이제 해당 커밋을 Discourse 코어에서 되돌렸습니다.
@cvx 님이 문제의 원인을 파악하고, upstream mail gem에 대한 이슈를 등록했습니다:
해당 문제가 해결되면, 다시 공식 gem으로 전환할 예정입니다.
보고해 주셔서 감사합니다 @Aubrey @topological @FlyingCat. 이제 해당 커밋을 Discourse 코어에서 되돌렸습니다.
@cvx 님이 문제의 원인을 파악하고, upstream 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 미들웨어가 설치되지 않습니다. 로컬 discourse 저장소에서 if 문을 제거하여 미들웨어가 항상 설치되도록 했습니다.
개발자(혹은 이 가이드의 작성자인 @rishabh 님?)가 이 문제를 도와줄 수 있을까요? Ubuntu 22.04가 설치된 새로운 VM에서 일반 사용자(비-root) 계정을 사용하여 OP의 가이드를 그대로 따랐습니다.
플러그인을 discourse/plugins/ 하위 폴더에 심볼릭 링크로 연결할 경우, d/shutdown_dev; d/boot_dev를 실행하지 않는 한 플러그인의 초기화자(initializer) JS 코드 변경 사항이 반영되지 않습니다. d/rails s와 d/ember-cli를 재시작해도 마찬가지입니다.
플러그인을 discourse/plugins/ 하위 폴더에 복사하여 넣을 경우, d/shutdown_dev; d/boot_dev를 실행하지 않고 d/rails s와 d/ember-cli만 재시작해도 플러그인의 초기화자 JS 코드 변경 사항이 반영됩니다.
해당 플러그인은 discourse-math이며, 수정 중인 코드는 assets/initializers/javascript/*.js 파일에 있습니다. 이 파일들이 사이드 로딩(side-loaded)되고 브라우저에 의해 직접 HTTP GET으로 호출되지 않는다는 점을 발견했습니다(이것이 차이를 만드는지 확신은 없습니다).
참고로 저는 웹/JS 개발에는 익숙하지만 Discourse만 처음 사용해 봅니다(즉, 브라우저를 새로고침했는지 묻지 않아도 됩니다
)
개발자분들 중 이 에러를 확인해 주실 수 있을까요? 제 상황과 관련된 특정 문제보다는 Ruby 자체와 관련된 문제인 것 같습니다. Windows에서 Docker 설치를 위한 이 안내에 따라 Discourse 개발용 설치를 진행 중인데, 이 과정은 이전에 여러 번 성공적으로 완료한 바 있습니다. 스크립트가 데이터베이스 설치 단계까지 진행되었고 이후 중단되었습니다. 첫 번째 경고는 치명적이지 않아 보이지만, 이 덤프의 하단에 xss.min.js 파일이 누락되어 있다는 메시지가 있으며, 이것이 치명적인 오류였습니다:
‘’'You are attempting to run migrations in your test environment and are not loading plugins, setting LOAD_PLUGINS to 1
DEPRECATION WARNING: Using legacy connection handling is deprecated. Please set
legacy_connection_handling to false in your application.
The new connection handling does not support connection_handlers
getter and setter.
Read more about how to migrate at: Multiple Databases with Active Record — Ruby on Rails Guides
(called from at /src/config/environment.rb:7)
== 20150501152228 RenameTotalVotesToVoters: migrating =========================
== 20150501152228 RenameTotalVotesToVoters: migrated (0.0106s) ================
== 20151016163051 MergePollsVotes: migrating ==================================
== 20151016163051 MergePollsVotes: migrated (0.0017s) =========================
== 20160321164925 ClosePollsInClosedTopics: migrating =========================
== 20160321164925 ClosePollsInClosedTopics: migrated (0.0281s) ================
== 20180820073549 CreatePollsTables: migrating ================================
– 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: migrated (0.0188s) =======================
== 20180820080623 MigratePollsData: migrating =================================
– 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: migrated (0.0033s) ========================
== 20191114160613 AddGraphToPolls: migrating ==================================
– add_column(:polls, :chart_type, :integer, {:default=>0, :null=>false})
→ 0.0012s
== 20191114160613 AddGraphToPolls: migrated (0.0020s) =========================
== 20191206123012 AddGroupNameToPolls: migrating ==============================
– add_column(:polls, :groups, :string, {})
→ 0.0005s
== 20191206123012 AddGroupNameToPolls: migrated (0.0012s) =====================
== 20200520015508 ClearLastGravatarDownloadAttemptOnUserAvatars: migrating ====
– 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: migrated (0.0014s)
== 20200804144550 AddTitleToPolls: migrating ==================================
– add_column(:polls, :title, :string, {})
→ 0.0005s
== 20200804144550 AddTitleToPolls: migrated (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
(See full trace by running task with --trace)‘’'}
훌륭한 자료를 공유해 주셔서 감사합니다. 몇 가지 도움이 될 만한 점을 정리해 드립니다:
데이터를 완전히 삭제하고 다시 시작하는 명령어는 다음과 같습니다:
docker stop discourse_dev ; docker rm discourse_dev ; sudo rm -rf data ; rm -rf tmp/*
위에서 언급한 것과 같은 마이그레이션 문제를 겪고 있다면 권한이 올바른지 확인하세요. docker 그룹에 속해 있거나 sudo를 사용해야 합니다(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 디렉터리에서 다음 명령을 실행하여 SELinux 컨텍스트 라벨을 적용했는데, 이것이 충분할 것이라 생각합니다(적어도 SELinux 오류는 사라졌습니다):
mkdir -vp data/postgres; sudo semanage fcontext -a -t svirt_sandbox_file_t "/home/user/discourse/data(/.*)?" && restorecon -rv .
하지만 여전히 다음과 같은 오류가 발생합니다:
[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 저널에는 다음과 같은 내용이 보고됩니다:
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 디렉터리 내의 로그 디렉터리는 비어 있습니다. 어떻게 더 잘 문제 해결할 수 있을까요?
경로는 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와 잘 호환되지 않는 것 같아 VM을 실행할 때 그래픽 오류가 많이 발생합니다. Fedora는 아주 부드럽게 작동하네요… 컨테이너가 포터블리티 문제를 해결해 줄 줄 알았더니
결국 헤드리스 Ubuntu 시스템을 설정하고 SSH로 로그인하는 방향으로 가볼 것 같습니다.
Ubuntu Server 22.04에서도 같은 오류가 발생합니다.
저도 같은 문제를 겪고 있습니다. @tarek님의 조언을 따랐고, 두 번이나 확인했습니다. 하지만 문제가 계속 반복됩니다. 또한 discourse 디렉터리 전체를 정리하고 처음부터 다시 시작해 보았습니다. VM에서 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 stable (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, 말한 것을 취소합니다. 컨테이너 내에서 다음 셸 명령을 사용하면 이를 재현할 수 있습니다:
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 덕분에 이것이 몇 가지 단서를 제공할 수 있을 것 같습니다:
cc: @pfaffman
안녕하세요 @Robert,
정신이 나간 줄 알았어요. 이 문제를 겪는 사람이 저뿐인 줄 알았거든요. 이 문제를 우회할 방법을 찾기 위해 애를 썼습니다. 이전에 북마크 문제를 해결하는 우회 방법을 찾은 게시글을 여기에 올린 적이 있지만, 이번에는 또 다른 문제에 부딪혔습니다:
이 문제를 해결하는 방법을 알려주시는 분 계신가요?
d/boot_dev --init를 실행하려고 할 때 이런 오류가 발생합니다.
rake aborted!
ActiveRecord::ConnectionNotEstablished: connection to server at "127.0.0.1", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "::1", port 5432 failed: Cannot assign requested address
Is the server running on that host and accepting TCP/IP connections?
/src/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/src/config/environment.rb:7:in `<main>'
Caused by:
PG::ConnectionBad: connection to server at "127.0.0.1", port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "::1", port 5432 failed: Cannot assign requested address
Is the server running on that host and accepting TCP/IP connections?
/src/config/initializers/006-ensure_login_hint.rb:8:in `block in <main>'
/src/config/environment.rb:7:in `<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --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)