Git Product home page Git Product logo

enju_leaf's People

Contributors

boronology avatar orumin avatar yufushiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

enju_leaf's Issues

DBの初期設定でSolrに依存する処理がある

事象

README中のデータベースの初期設定において

docker-compose run --rm web bundle exec rake enju_leaf:setup

を実行すると失敗する。

ログ

RSolr::Error::ConnectionRefused: Connection refused - {:data=>"[{"id":"Shelf 1","type":["Shelf","ApplicationRecord","ActiveRecord::Base"],"class_name":"Shelf","shelf_name_s":"web","library_s":"web","position_i":"1","name_text":["web","web","ja: web","World Wide Web"]}]", :headers=>{"Content-Type"=>"application/json"}, :method=>:post, :params=>{:wt=>:json}, :query=>"wt=json", :path=>"update", :uri=>#<URI::HTTP http://solr:8983/solr/default/update?wt=json>}

Caused by:
Faraday::ConnectionFailed: Failed to open TCP connection to solr:8983 (getaddrinfo: Name does not resolve)

等となっており、Solrとの通信が必要だったことがわかる。

対応案

export DB_USER=enju_leaf DB_NAME=enju_leaf_production DB_PASS=admin # .env.production に合わせる
docker-compose up -d db \
  && sleep 10 \
  && docker-compose exec -u postgres db sh -c "echo create user ${DB_USER} with password \'${DB_PASS}\' createdb\; | psql -f -" \
  && docker-compose exec -u postgres db createdb -U ${DB_USER} ${DB_NAME}
docker-compose up -d solr # <- new
docker-compose run --rm web bundle exec rake db:migrate
docker-compose run --rm web bundle exec rake enju_leaf:setup
docker-compose run --rm web bundle exec rake enju_circulation:setup
docker-compose run --rm web bundle exec rake enju_subject:setup
docker-compose run --rm web bundle exec rake db:seed

Postgres12ではデータベースの初期設定時にPOSTGRES_PASSWORD環境変数が必要

READMEにある手順

export DB_USER=enju_leaf DB_NAME=enju_leaf_production DB_PASS=admin # .env.production に合わせる
docker-compose up -d db \
  && sleep 10 \
  && docker-compose exec -u postgres db sh -c "echo create user ${DB_USER} with password \'${DB_PASS}\' createdb\; | psql -f -" \
  && docker-compose exec -u postgres db createdb -U ${DB_USER} ${DB_NAME}

を実行すると

Error response from daemon: Container *** is restarting, wait until the container is running

となり失敗する。
docker-compose logsによると

db_1 | Error: Database is uninitialized and superuser password is not specified.
db_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the
db_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
db_1 |
db_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
db_1 | connections without a password. This is not recommended.
db_1 |
db_1 | See PostgreSQL documentation about "trust":
db_1 | https://www.postgresql.org/docs/current/auth-trust.html

となっているため、一時的にdocker-compose.ymlで

    environment:
      - POSTGRES_PASSWORD=admin

する等の対応が必要になる。

ISBNだけ指定したときのTSVインポートに失敗する

TSVインポート時にISBNを指定するとexecution_expiredでインポートに失敗する。

docker-compose.yml でresqueのnetworkにexternal_networkを足したところ解決した。

環境

  • dockerを実行しているOS: Windows 10 pro 64bitのvirtualbox上に建てたubuntu-server 17.10
  • ubuntu-serverのネットワーク: NATとホストオンリーアダプタ

resqueに出ていたエラーの詳細

Exception: Net::OpenTimeout
Error: execution expired
/usr/local/lib/ruby/2.6.0/net/http.rb:947:in `initialize'
/usr/local/lib/ruby/2.6.0/net/http.rb:947:in `open'
/usr/local/lib/ruby/2.6.0/net/http.rb:947:in `block in connect'
/usr/local/lib/ruby/2.6.0/timeout.rb:103:in `timeout'
/usr/local/lib/ruby/2.6.0/net/http.rb:945:in `connect'
/usr/local/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
/usr/local/lib/ruby/2.6.0/net/http.rb:919:in `start'
/usr/local/lib/ruby/2.6.0/open-uri.rb:337:in `open_http'
/usr/local/lib/ruby/2.6.0/open-uri.rb:756:in `buffer_open'
/usr/local/lib/ruby/2.6.0/open-uri.rb:226:in `block in open_loop'
/usr/local/lib/ruby/2.6.0/open-uri.rb:224:in `catch'
/usr/local/lib/ruby/2.6.0/open-uri.rb:224:in `open_loop'
/usr/local/lib/ruby/2.6.0/open-uri.rb:165:in `open_uri'
/usr/local/lib/ruby/2.6.0/open-uri.rb:736:in `open'
/usr/local/lib/ruby/2.6.0/open-uri.rb:744:in `read'
/usr/local/lib/ruby/2.6.0/rss/parser.rb:122:in `normalize_rss'
/usr/local/lib/ruby/2.6.0/rss/parser.rb:108:in `initialize'
/usr/local/lib/ruby/2.6.0/rss/parser.rb:85:in `new'
/usr/local/lib/ruby/2.6.0/rss/parser.rb:85:in `parse'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_ndl-0.3.0/lib/enju_ndl/ndl_search.rb:266:in `search_ndl'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_ndl-0.3.0/lib/enju_ndl/ndl_search.rb:279:in `return_xml'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_ndl-0.3.0/lib/enju_ndl/ndl_search.rb:30:in `import_from_ndl_search'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_ndl-0.3.0/lib/enju_ndl/ndl_search.rb:10:in `import_isbn'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_biblio-0.3.1/app/models/resource_import_file.rb:163:in `block in import'
/usr/local/lib/ruby/2.6.0/csv/parser.rb:699:in `emit_row'
/usr/local/lib/ruby/2.6.0/csv/parser.rb:259:in `parse'
/usr/local/lib/ruby/2.6.0/csv.rb:1171:in `each'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_biblio-0.3.1/app/models/resource_import_file.rb:80:in `import'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_biblio-0.3.1/app/models/resource_import_file.rb:49:in `import_start'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/enju_biblio-0.3.1/app/jobs/resource_import_file_job.rb:5:in `perform'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/execution.rb:37:in `block in perform_now'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/i18n-1.5.3/lib/i18n.rb:284:in `with_locale'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/translation.rb:7:in `block (2 levels) in <module:Translation>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `instance_exec'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/logging.rb:24:in `block (4 levels) in <module:Logging>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/notifications.rb:166:in `block in instrument'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/notifications.rb:166:in `instrument'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/logging.rb:23:in `block (3 levels) in <module:Logging>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/logging.rb:44:in `block in tag_logger'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:69:in `block in tagged'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:26:in `tagged'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/tagged_logging.rb:69:in `tagged'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/logging.rb:44:in `tag_logger'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/logging.rb:20:in `block (2 levels) in <module:Logging>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `instance_exec'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:135:in `run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/execution.rb:33:in `perform_now'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/execution.rb:22:in `block in execute'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/railtie.rb:26:in `block (4 levels) in <class:Railtie>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/execution_wrapper.rb:85:in `wrap'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/reloader.rb:68:in `block in wrap'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/execution_wrapper.rb:85:in `wrap'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/reloader.rb:67:in `wrap'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/railtie.rb:25:in `block (3 levels) in <class:Railtie>'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `instance_exec'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activesupport-5.1.6.1/lib/active_support/callbacks.rb:135:in `run_callbacks'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/execution.rb:20:in `execute'
/enju_leaf/vendor/bundle/ruby/2.6.0/gems/activejob-5.1.6.1/lib/active_job/queue_adapters/resque_adapter.rb:45:in `perform'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.