ReBirth部署问题

执行报错的,这个需要检查哪里

直接在浏览器中访问

http://ip:8888/api/blocks

ip替换成你的公网ip

这个是server内部错误,报的500


放到浏览器中也是同样的错误
image

区块数据无法返回
但是http://localhost:8888/api/info/url
返回:{“result”:{“http_url”:“http://localhost:1337/",“ws_url”:"ws://localhost:4337/”}}

这个是什么原因引起的呢,求解答

500是服务内部错误,需要给下服务的出错日志,日志文件在
log/development.log 或 log/production.log (不同运行模式的日志文件不同)

tail -100f log/production.log

D, [2019-04-17T03:15:34.957044 #1] DEBUG -- :    (15.9ms)  CREATE  INDEX  "index_transactions_on_block_hash" ON "transactions"  ("block_hash")
D, [2019-04-17T03:15:34.980556 #1] DEBUG -- :    (6.9ms)  CREATE  INDEX  "index_transactions_on_from" ON "transactions"  ("from")
D, [2019-04-17T03:15:35.000717 #1] DEBUG -- :    (11.8ms)  CREATE  INDEX  "index_transactions_on_to" ON "transactions"  ("to")
D, [2019-04-17T03:15:35.021249 #1] DEBUG -- :    (8.6ms)  CREATE UNIQUE INDEX  "index_transactions_on_tx_hash" ON "transactions"  ("tx_hash")
D, [2019-04-17T03:15:35.023124 #1] DEBUG -- :    (0.4ms)  DROP TABLE IF EXISTS "validator_caches" CASCADE
D, [2019-04-17T03:15:35.049902 #1] DEBUG -- :    (25.9ms)  CREATE TABLE "validator_caches" ("id" bigserial primary key, "name" character varying NOT NULL, "counter" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
D, [2019-04-17T03:15:35.092344 #1] DEBUG -- :    (19.9ms)  CREATE UNIQUE INDEX  "index_validator_caches_on_name" ON "validator_caches"  ("name")
D, [2019-04-17T03:15:35.121570 #1] DEBUG -- :    (23.0ms)  CREATE TABLE "schema_migrations" ("version" character varying NOT NULL PRIMARY KEY)
D, [2019-04-17T03:15:35.178135 #1] DEBUG -- :    (4.8ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
D, [2019-04-17T03:15:35.185571 #1] DEBUG -- :    (2.9ms)  INSERT INTO "schema_migrations" (version) VALUES (20190103060302)
D, [2019-04-17T03:15:35.187153 #1] DEBUG -- :    (1.0ms)  INSERT INTO "schema_migrations" (version) VALUES
(20181220070637),
(20181101035658),
(20181220083423),
(20181226101553),
(20180619034736),
(20181220092458),
(20181226103138),
(20180807030924),
(20181226075716),
(20181226101230),
(20180619061147),
(20181227091201),
(20180706061134),
(20181101095358),
(20180807073702),
(20180705032658),
(20180709091027),
(20180817090233),
(20180704082334),
(20180816073015),
(20181220092401),
(20181220093106),
(20181009022937),
(20180823023239),
(20181226102501),
(20180917092311),
(20190103060058),
(20181226102120),
(20181220093811),
(20181220075708),
(20181220074930),
(20180919033713),
(20181220094434),
(20181220093546),
(20181220091018),
(20180711075733),
(20180903024536),
(20180706063551),
(20181229030703),
(20180704092420),
(20180917030158);


D, [2019-04-17T03:15:35.211270 #1] DEBUG -- :    (17.0ms)  CREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
D, [2019-04-17T03:15:35.226652 #1] DEBUG -- :   ActiveRecord::InternalMetadata Load (3.2ms)  SELECT  "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2  [["key", "environment"], ["LIMIT", 1]]
D, [2019-04-17T03:15:35.233582 #1] DEBUG -- :    (0.2ms)  BEGIN
D, [2019-04-17T03:15:35.237929 #1] DEBUG -- :   ActiveRecord::InternalMetadata Create (2.9ms)  INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"  [["key", "environment"], ["value", "production"], ["created_at", "2019-04-17 03:15:35.234501"], ["updated_at", "2019-04-17 03:15:35.234501"]]
D, [2019-04-17T03:15:35.239072 #1] DEBUG -- :    (0.6ms)  COMMIT
D, [2019-04-17T03:15:35.243608 #1] DEBUG -- :   ActiveRecord::InternalMetadata Load (0.9ms)  SELECT  "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2  [["key", "environment"], ["LIMIT", 1]]
D, [2019-04-17T03:15:35.247579 #1] DEBUG -- :    (0.2ms)  BEGIN
D, [2019-04-17T03:15:35.250346 #1] DEBUG -- :    (0.2ms)  COMMIT
D, [2019-04-17T03:15:35.329626 #1] DEBUG -- :    (5.1ms)  SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
I, [2019-04-17T03:16:44.253504 #16]  INFO -- : [7d172034-7a1f-4b54-bf3d-103d875fe1b6] Started GET "/api/info/curl" for 192.168.80.7 at 2019-04-17 03:16:44 +0000
I, [2019-04-17T03:16:44.275756 #16]  INFO -- : [7d172034-7a1f-4b54-bf3d-103d875fe1b6] Processing by ApplicationController#not_found as */*
I, [2019-04-17T03:16:44.276650 #16]  INFO -- : [7d172034-7a1f-4b54-bf3d-103d875fe1b6]   Parameters: {"path"=>"api/info/curl"}
I, [2019-04-17T03:16:44.286401 #16]  INFO -- : [7d172034-7a1f-4b54-bf3d-103d875fe1b6] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.66ms)
I, [2019-04-17T03:16:44.287366 #16]  INFO -- : [7d172034-7a1f-4b54-bf3d-103d875fe1b6] Completed 404 Not Found in 10ms (Views: 5.2ms)
I, [2019-04-17T03:17:18.989226 #16]  INFO -- : [5f7735a3-5983-48f7-b42c-adc7fce96dae] Started GET "/api/info/url" for 192.168.80.7 at 2019-04-17 03:17:18 +0000
I, [2019-04-17T03:17:18.990996 #16]  INFO -- : [5f7735a3-5983-48f7-b42c-adc7fce96dae] Processing by Api::InfoController#url as */*
I, [2019-04-17T03:17:18.993734 #16]  INFO -- : [5f7735a3-5983-48f7-b42c-adc7fce96dae] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.26ms)
I, [2019-04-17T03:17:18.994580 #16]  INFO -- : [5f7735a3-5983-48f7-b42c-adc7fce96dae] Completed 200 OK in 3ms (Views: 1.6ms)
I, [2019-04-17T03:17:24.578997 #16]  INFO -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] Started GET "/api/blocks" for 192.168.80.7 at 2019-04-17 03:17:24 +0000
I, [2019-04-17T03:17:24.580295 #16]  INFO -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] Processing by Api::BlocksController#index as */*
D, [2019-04-17T03:17:24.734639 #16] DEBUG -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55]    (9.9ms)  SELECT COUNT(*) FROM "blocks"
D, [2019-04-17T03:17:24.739484 #16] DEBUG -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] [active_model_serializers]   Block Load (2.5ms)  SELECT  "blocks".* FROM "blocks" ORDER BY "blocks"."block_number" DESC LIMIT $1 OFFSET $2  [["LIMIT", 10], ["OFFSET", 0]]
I, [2019-04-17T03:17:24.741018 #16]  INFO -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] [active_model_serializers] Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::Attributes (0.58ms)
I, [2019-04-17T03:17:24.741460 #16]  INFO -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (5.85ms)
I, [2019-04-17T03:17:24.741909 #16]  INFO -- : [be6606f0-731e-41cc-88ef-fe9569f9ef55] Completed 200 OK in 161ms (Views: 4.0ms | ActiveRecord: 61.6ms)
I, [2019-04-17T03:18:03.124269 #16]  INFO -- : [3a343735-f20f-4d0d-929d-e22f89df7290] Started GET "/api/transactions" for 192.168.80.7 at 2019-04-17 03:18:03 +0000
I, [2019-04-17T03:18:03.128370 #16]  INFO -- : [3a343735-f20f-4d0d-929d-e22f89df7290] Processing by Api::TransactionsController#index as */*
D, [2019-04-17T03:18:03.183105 #16] DEBUG -- : [3a343735-f20f-4d0d-929d-e22f89df7290]    (20.3ms)  SELECT COUNT(*) FROM "transactions"
D, [2019-04-17T03:18:03.194090 #16] DEBUG -- : [3a343735-f20f-4d0d-929d-e22f89df7290] [active_model_serializers]   Transaction Load (7.6ms)  SELECT  "transactions".* FROM "transactions" ORDER BY "transactions"."updated_at" DESC LIMIT $1 OFFSET $2  [["LIMIT", 10], ["OFFSET", 0]]
I, [2019-04-17T03:18:03.196317 #16]  INFO -- : [3a343735-f20f-4d0d-929d-e22f89df7290] [active_model_serializers] Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::Attributes (0.06ms)
I, [2019-04-17T03:18:03.196888 #16]  INFO -- : [3a343735-f20f-4d0d-929d-e22f89df7290] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (11.59ms)
I, [2019-04-17T03:18:03.197499 #16]  INFO -- : [3a343735-f20f-4d0d-929d-e22f89df7290] Completed 200 OK in 68ms (Views: 4.8ms | ActiveRecord: 43.2ms)
I, [2019-04-17T03:18:31.356312 #16]  INFO -- : [7001f07f-6428-4708-b883-72d392f652c9] Started GET "/api/blocks" for 192.168.80.7 at 2019-04-17 03:18:31 +0000
I, [2019-04-17T03:18:31.359103 #16]  INFO -- : [7001f07f-6428-4708-b883-72d392f652c9] Processing by Api::BlocksController#index as */*
D, [2019-04-17T03:18:31.370941 #16] DEBUG -- : [7001f07f-6428-4708-b883-72d392f652c9]    (5.2ms)  SELECT COUNT(*) FROM "blocks"
D, [2019-04-17T03:18:31.374924 #16] DEBUG -- : [7001f07f-6428-4708-b883-72d392f652c9] [active_model_serializers]   Block Load (2.6ms)  SELECT  "blocks".* FROM "blocks" ORDER BY "blocks"."block_number" DESC LIMIT $1 OFFSET $2  [["LIMIT", 10], ["OFFSET", 0]]
I, [2019-04-17T03:18:31.375606 #16]  INFO -- : [7001f07f-6428-4708-b883-72d392f652c9] [active_model_serializers] Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::Attributes (0.04ms)
I, [2019-04-17T03:18:31.376186 #16]  INFO -- : [7001f07f-6428-4708-b883-72d392f652c9] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (4.39ms)
I, [2019-04-17T03:18:31.376835 #16]  INFO -- : [7001f07f-6428-4708-b883-72d392f652c9] Completed 200 OK in 16ms (Views: 2.6ms | ActiveRecord: 7.8ms)
I, [2019-04-17T03:18:40.922389 #16]  INFO -- : [e2c3f430-d57c-44d0-a783-875706730ecf] Started GET "/api/blocks" for 192.168.80.7 at 2019-04-17 03:18:40 +0000
I, [2019-04-17T03:18:40.924695 #16]  INFO -- : [e2c3f430-d57c-44d0-a783-875706730ecf] Processing by Api::BlocksController#index as HTML
D, [2019-04-17T03:18:40.934700 #16] DEBUG -- : [e2c3f430-d57c-44d0-a783-875706730ecf]    (4.6ms)  SELECT COUNT(*) FROM "blocks"
D, [2019-04-17T03:18:40.938209 #16] DEBUG -- : [e2c3f430-d57c-44d0-a783-875706730ecf] [active_model_serializers]   Block Load (2.2ms)  SELECT  "blocks".* FROM "blocks" ORDER BY "blocks"."block_number" DESC LIMIT $1 OFFSET $2  [["LIMIT", 10], ["OFFSET", 0]]
I, [2019-04-17T03:18:40.938912 #16]  INFO -- : [e2c3f430-d57c-44d0-a783-875706730ecf] [active_model_serializers] Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::Attributes (0.06ms)
I, [2019-04-17T03:18:40.939745 #16]  INFO -- : [e2c3f430-d57c-44d0-a783-875706730ecf] [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (4.19ms)
I, [2019-04-17T03:18:40.940427 #16]  INFO -- : [e2c3f430-d57c-44d0-a783-875706730ecf] Completed 200 OK in 14ms (Views: 2.9ms | ActiveRecord: 6.8ms)

可能是docker容器需要配置一下吧,,
我当时直接将re-birth目录下的 .env 文件里面
CITA_URL="http://localhost:1337/"
这一行的localhost替换成了公网ip,re-brith就正常了

@classicalliu 看不到有报错日志,any idea?

已经解决,方法:

centos 部署re-birth,执行rails daemons:sync:start命令,报错

	17: from /data/re-birth/lib/sync_control.rb:30:in `<main>'
	16: from /data/re-birth/app/models/event_log_processor.rb:20:in `tables'
	15: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_handling.rb:90:in `connection'
	14: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
	13: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:1010:in `retrieve_connection'
	12: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
	11: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:523:in `checkout'
	10: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:795:in `acquire_connection'
	 9: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:834:in `try_to_checkout_new_connection'
	 8: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:855:in `checkout_new_connection'
	 7: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:811:in `new_connection'
	 6: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `postgresql_connection'
	 5: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `new'
	 4: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in `initialize'
	 3: from /usr/local/rvm/gems/ruby-2.5.3/gems/activerecord-5.2.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:692:in `connect'
	 2: from /usr/local/rvm/gems/ruby-2.5.3/gems/pg-1.1.3/lib/pg.rb:56:in `connect'
	 1: from /usr/local/rvm/gems/ruby-2.5.3/gems/pg-1.1.3/lib/pg.rb:56:in `new'
/usr/local/rvm/gems/ruby-2.5.3/gems/pg-1.1.3/lib/pg.rb:56:in `initialize': FATAL:  Ident authentication failed for user "postgres" (PG::ConnectionBad)```
但是我用客户端直接连数据库,用户名,密码是正确的,能连上,请问是什么问题?

你是按照哪个说明操作的?是不是还有些步骤忘记执行了?
这里错误好像是说数据库没有连上。

按照
https://github.com/cryptape/re-birth/blob/develop/README-CN.md
操作的.
依赖-初始化-执行.

找到问题了,是数据库的配置问题,需要修改pg_hba.conf中的认证方式为password.

1赞