Unknown MySQL server host 'db' (2)
Extracted source (around line #89):
87
88
89
90
91
92
|
socket = socket.to_s unless socket.nil?
connect user, pass, host, port, database, socket, flags
end
def parse_ssl_mode(mode)
|
Extracted source (around line #89):
87
88
89
90
91
92
|
socket = socket.to_s unless socket.nil?
connect user, pass, host, port, database, socket, flags
end
def parse_ssl_mode(mode)
|
Extracted source (around line #22):
20
21
22
23
24
25
|
end
client = Mysql2::Client.new(config)
ConnectionAdapters::Mysql2Adapter.new(client, logger, nil, config)
rescue Mysql2::Error => error
if error.message.include?("Unknown database")
|
Extracted source (around line #22):
20
21
22
23
24
25
|
end
client = Mysql2::Client.new(config)
ConnectionAdapters::Mysql2Adapter.new(client, logger, nil, config)
rescue Mysql2::Error => error
if error.message.include?("Unknown database")
|
Extracted source (around line #809):
807
808
809
810
811
812
|
def new_connection
Base.send(spec.adapter_method, spec.config).tap do |conn|
conn.schema_cache = schema_cache.dup if schema_cache
end
end
|
Extracted source (around line #853):
851
852
853
854
855
856
|
def checkout_new_connection
raise ConnectionNotEstablished unless @automatic_reconnect
new_connection
end
def checkout_and_verify(c)
|
Extracted source (around line #832):
830
831
832
833
834
835
|
# if successfully incremented @now_connecting establish new connection
# outside of synchronized section
conn = checkout_new_connection
ensure
synchronize do
if conn
|
Extracted source (around line #793):
791
792
793
794
795
796
|
# and +try_to_checkout_new_connection+ we can piggyback on +synchronize+ sections
# of the said methods and avoid an additional +synchronize+ overhead.
if conn = @available.poll || try_to_checkout_new_connection
conn
else
reap
|
Extracted source (around line #521):
519
520
521
522
523
524
|
# - ActiveRecord::ConnectionTimeoutError no connection can be obtained from the pool.
def checkout(checkout_timeout = @checkout_timeout)
checkout_and_verify(acquire_connection(checkout_timeout))
end
# Check-in a database connection back into the pool, indicating that you
|
Extracted source (around line #380):
378
379
380
381
382
383
|
# held in a cache keyed by a thread.
def connection
@thread_cached_conns[connection_cache_key(@lock_thread || Thread.current)] ||= checkout
end
# Returns true if there is an open connection being used for the current thread.
|
Extracted source (around line #1008):
1006
1007
1008
1009
1010
1011
|
pool = retrieve_connection_pool(spec_name)
raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool
pool.connection
end
# Returns true if a connection that's accessible to this class has
|
Extracted source (around line #118):
116
117
118
119
120
121
|
def retrieve_connection
connection_handler.retrieve_connection(connection_specification_name)
end
# Returns +true+ if Active Record is connected.
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# to any of the specific Active Records.
def connection
retrieve_connection
end
attr_writer :connection_specification_name
|
Extracted source (around line #554):
552
553
554
555
556
557
|
def call(env)
mtime = ActiveRecord::Base.connection.migration_context.last_migration.mtime.to_i
if @last_check < mtime
ActiveRecord::Migration.check_pending!(connection)
@last_check = mtime
|
Extracted source (around line #28):
26
27
28
29
30
31
|
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
end
end
|
Extracted source (around line #98):
96
97
98
99
100
101
|
if callbacks.empty?
yield if block_given?
else
env = Filters::Environment.new(self, false, nil)
next_sequence = callbacks.compile
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def call(env)
error = nil
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
|
Extracted source (around line #14):
12
13
14
15
16
17
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #61):
59
60
61
62
63
64
|
def call(env)
request = ActionDispatch::Request.new env
_, headers, body = response = @app.call(env)
if headers["X-Cascade"] == "pass"
body.close if body.respond_to?(:close)
|
Extracted source (around line #33):
31
32
33
34
35
36
|
def call(env)
request = ActionDispatch::Request.new env
@app.call(env)
rescue Exception => exception
if request.show_exceptions?
render_exception(request, exception)
|
Extracted source (around line #38):
36
37
38
39
40
41
|
instrumenter.start "request.action_dispatch", request: request
logger.info { started_request_message(request) }
status, headers, body = @app.call(env)
body = ::Rack::BodyProxy.new(body) { finish(request) }
[status, headers, body]
rescue Exception
|
Extracted source (around line #28):
26
27
28
29
30
31
|
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
end
|
Extracted source (around line #13):
11
12
13
14
15
16
|
::Rails.logger.silence { @app.call(env) }
else
@app.call(env)
end
end
end
|
Extracted source (around line #81):
79
80
81
82
83
84
|
req = ActionDispatch::Request.new env
req.remote_ip = GetIp.new(req, check_ip, proxies)
@app.call(req.env)
end
# The GetIp class exists as a way to defer processing of the request data
|
Extracted source (around line #27):
25
26
27
28
29
30
|
req = ActionDispatch::Request.new env
req.request_id = make_request_id(req.x_request_id)
@app.call(env).tap { |_status, headers, _body| headers[X_REQUEST_ID] = req.request_id }
end
private
|
Extracted source (around line #24):
22
23
24
25
26
27
|
end
@app.call(env)
end
def method_override(env)
|
Extracted source (around line #22):
20
21
22
23
24
25
|
def call(env)
start_time = Utils.clock_time
status, headers, body = @app.call(env)
headers = Utils::HeaderHash[headers]
request_time = Utils.clock_time - start_time
|
Extracted source (around line #29):
27
28
29
30
31
32
|
def call(env)
LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
LocalCacheRegistry.set_cache_for(local_cache_key, nil)
end
|
Extracted source (around line #14):
12
13
14
15
16
17
|
state = @executor.run!
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #127):
125
126
127
128
129
130
|
end
@app.call(req.env)
end
end
end
|
Extracted source (around line #110):
108
109
110
111
112
113
|
def call(env)
status, headers, body = @app.call(env)
if body.respond_to?(:to_path)
case type = variation(env)
when 'X-Accel-Redirect'
|
Extracted source (around line #100):
98
99
100
101
102
103
|
vary_resource = resource_for_path(path)
status, headers, body = @app.call env
if add_headers
headers = add_headers.merge(headers)
|
Extracted source (around line #524):
522
523
524
525
526
527
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #97):
95
96
97
98
99
100
|
begin
status, headers, body = @app.call(env)
rescue => e
if !should_swallow_app_error?(e, socket_wrapper)
# It's a good idea to catch application exceptions here because
|
Extracted source (around line #149):
147
148
149
150
151
152
|
begin
if headers[REQUEST_METHOD] == GET
process_request(headers, connection, socket_wrapper, @protocol == :http)
elsif headers[REQUEST_METHOD] == PING
process_ping(headers, connection)
false
|
Extracted source (around line #110):
108
109
110
111
112
113
|
finish_callback.call
while true
hijacked = accept_and_process_next_request(socket_wrapper, channel, buffer)
socket_wrapper = Utils::UnseekableSocket.new if hijacked
end
rescue Interrupted
|
Extracted source (around line #415):
413
414
415
416
417
418
|
handler = thread_handler.new(self, main_socket_options)
handler.install
handler.main_loop(set_initialization_state_to_true)
ensure
set_initialization_state.call(false)
unregister_current_thread
|
Extracted source (around line #113):
111
112
113
114
115
116
|
Thread.current.abort_on_exception = true
begin
yield(*args)
rescue SystemExit
raise
rescue Exception => e
|
Rails.root: /home/trairy/rails/trairy_new
Request
Parameters:
None
HTTP_ACCEPT: "*/*"
HTTP_VERSION: "HTTP/1.1"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "107.23.156.199"
SERVER_NAME: "trairy.jp"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None