めんてなのおしごと

Wed, Apr 10, 2019  in debian debian

fluentdパッケージングでのテストエラー続き。

? Encoding: US-ASCII-8BIT
===============================================================================
: (0.005571)
    test: should output compressed file when compress option is gzip:   F
===============================================================================
Failure: test: should output compressed file when compress option is gzip(FileOutputSecondaryTest::write)
/build/fluentd-1.4.2/test/plugin/test_out_secondary_file.rb:129:in `check_gzipped_result'
/build/fluentd-1.4.2/test/plugin/test_out_secondary_file.rb:154:in `block (2 levels) in <class:FileOutputSecondaryTest>'
     151:       path = d.instance.write(@chunk)
     152: 
     153:       assert_equal "#{TMP_DIR}/out_file_test.0.gz", path
  => 154:       check_gzipped_result(path, @es.to_msgpack_stream.force_encoding('ASCII-8BIT'))
     155:     end
     156: 
     157:     test 'should output plain text when compress option is default(text)' do
<"\x92\xD7\x00\\\xAC\x83\x81\x04\x04Z\x9F\x81\xA3key\xA5value">(ASCII-8BIT) expected but was
<"\x92\xD7\x00\\\xAC\x83\x81\x04\x04Z\x9F\x81\xA3key\xA5value">(US-ASCII)

diff:
  ^@\ャメ^D^DZ氈keyvalue

文字列の比較のようだが、同じ様に見える…のにエンコーディングが違う?どこでこのエンコーディング指定してるのだろう?とTravis CIのログをみてなるほどーとなってパッチ。

  Gem2Deb::Rake::TestTask.new do |t|
    t.libs = ['test']
    t.test_files = FileList['test/**/*_test.rb'] + FileList['test/**/test_*.rb']
+   t.ruby_opts = ["-Eascii-8bit:ascii-8bit"]
  end

しかし、エラーがどうしても一つ潰せず、upstreamにIssueを上げた


めんてなのおしごと

Tue, Apr 9, 2019  in debian debian

fluentdのビルド…テストがエラーになる。

2748 tests, 11159 assertions, 15 failures, 3 errors, 0 pendings, 0 omissions, 1 notifications

という感じ。見ていく。

Failure: test: dump txt[--format=markdown --verbose --compact](TestFluentPluginConfigFormatter::arguments):
  Exception raised:
  Errno::ENOENT(<No such file or directory @ realpath_rec - /build/fluentd-1.4.2/debian/fluentd/usr/lib/ruby/templates>)
/build/fluentd-1.4.2/test/command/test_plugin_config_formatter.rb:270:in `block (3 levels) in <class:TestFluentPluginConfigFormatter>'
# grep templates -r ./
(snip)
./lib/fluent/command/plugin_generator.rb:    (Pathname(__dir__) + "../../../templates/new_gem").realpath
./lib/fluent/command/plugin_config_formatter.rb:    (Pathname(__dir__) + "../../../templates/plugin_config_formatter/#{name}").realpath

/build/fluentd-1.4.2/templatesを見たいのに/build/fluentd-1.4.2/debian/fluentd/usr/lib/ruby/templatesを参照しにいってるので、ここを直せば良い。templatesをlib配下に持っていって相対パスをadjustするのがよいかね。


/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized
/usr/lib/ruby/vendor_ruby/flexmock/core.rb:92: warning: instance variable @flexmock_closed not initialized

とwarningが5万行も出ていたので、ruby-flexmockパッケージになにか問題が?と思って見てみると2年ほど更新が滞ってる。パッケージメンテナが降りてしまってるので、自分を加えて更新してアップロードした


psがない!というエラーが出ていたので、これは最小環境にprocpsパッケージが入ってないことによるものだったので、さくっと解決。


しかしまだまだtest failureは続く…。


めんてなのおしごと

Mon, Apr 8, 2019  in debian debian

パッケージング、残りはruby-strptimeruby-tzinfo-dataか、ということでruby-strptimeのITP作業した。ruby-tzinfo-dataの方はtzdataを引っ張ってこれない環境だと必要なのでは?と判断して削る方向で…あ、ruby-parallel-testsも追加。

これで大体依存関係終わったかな…。

ここまで来て、ようやくfluentdのパッケージングに再度入れる。


めんてなのおしごと

Sun, Apr 7, 2019  in debian debian

先日gem2debで変換したruby-dig-rbを仕上げておこうとしてdescription書く際にサイトを見て「ん?」と気付く。

Ruby 2.3.0 introduced #dig on Hash, Array, and Struct. With this gem, you can have dig on ruby pre 2.3.0, or any ruby lacking dig.

If you are writing an app and want to use dig in it you should probably just upgrade to ruby 2.3.0. But if you are writing a gem and want it to work with both MRI 2.3.0 and others (including JRuby 9.0.x), this gem is for you. This gem only adds #dig methods if they aren't already defined, so it's safe to use in code that is for all rubies, if run on MRI 2.3.0 you'll still be using native #dig, otherwise dig_rb's implementation.

Ruby2.3で同じ機能を導入してるから、CRuby以外の実装で必要だ、という場合以外は不要だということか…。んでは無視しよう。fluentdにはPR上げてみておいた


めんてなのおしごと

Wed, Apr 3, 2019  in debian debian

itamaeのアップデートにfluentdが必要そうなのでこちらをやろうとしてみる。

$ gem2deb fluentd
fluentd doesn't seem to exist. Let's try to download it with 'gem fetch fluentd'
gem fetch fluentd
Fetching: fluentd-1.4.2.gem (100%)
Downloaded fluentd-1.4.2
-- Creating source tarball from fluentd-1.4.2.gem ...
tar xfm /home/henrich/src/pkg-ruby-extras/fluentd-1.4.2.gem
"tar xzfm data.tar.gz"
tar czf /home/henrich/src/pkg-ruby-extras/fluentd-1.4.2.tar.gz fluentd-1.4.2
-- Successfully created ./fluentd-1.4.2.tar.gz

-- Creating Debian source package from ./fluentd-1.4.2.tar.gz ...
tar xzf ruby-fluentd_1.4.2.orig.tar.gz
-- Generated Debian source tree in ruby-fluentd-1.4.2

-- Building Debian package ...
dpkg-buildpackage -us -uc
dpkg-buildpackage: info: source package ruby-fluentd
dpkg-buildpackage: info: source version 1.4.2-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Hideki Yamane <henrich@debian.org>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
dpkg-checkbuilddeps: error: Unmet build dependencies: ruby-cool.io (<< 2.0.0) ruby-cool.io (>= 1.4.5) ruby-dig-rb (>= 1.0.0) ruby-http-parser.rb (<< 0.7.0) ruby-http-parser.rb (>= 0.5.1) ruby-msgpack (<< 2.0.0) ruby-msgpack (>= 0.7.0) ruby-serverengine (<< 3.0.0) ruby-serverengine (>= 2.0.4) ruby-sigdump (>= 0.2.2) ruby-strptime (<< 1.0.0) ruby-strptime (>= 0.2.2) ruby-tzinfo (>= 1.0) ruby-tzinfo-data (>= 1.0) ruby-yajl (>= 1.0)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting

依存関係が解決できなくてビルド失敗してる。ruby-cool.ioパッケージが無いようなので、まずはこちらから作業。gem2debでサクッと変換…と思いきや

$ gem2deb cool.io
(snip)
dpkg-checkbuilddeps: error: Unmet build dependencies: ruby-rspec
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting

なぜにruby-rspecが無いとでる?

$ apt show ruby-rspec
Package: ruby-rspec
Version: 3.8.0c0e1m0s0-1
Priority: optional
Section: ruby

あるよ?…もしかして、作業環境に入ってないから?いやーcowbuilderみたいにビルド環境で処理してよ…。とりあえず諸々作業…テストがコケたが、DNSを引きにいくものだったので無効にした。再度ビルド…

   dh_dwz -O--buildsystem=ruby
dwz: debian/ruby-cool.io/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/cool.io_ext.so: DWARF version 0 unhandled
dwz: debian/ruby-cool.io/usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/2.5.0/iobuffer_ext.so: DWARF version 0 unhandled
dwz: Too few files for multifile optimization
objcopy: 'debian/ruby-cool.io/usr/lib/debug/.dwz/x86_64-linux-gnu/ruby-cool.io.debug': No such file
dh_dwz: objcopy --compress-debug-sections debian/ruby-cool.io/usr/lib/debug/.dwz/x86_64-linux-gnu/ruby-cool.io.debug returned exit code 1
make: *** [debian/rules:6: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

どうもdebhelper level12で出る問題なのだけど、dh_dwzって全く理解してないので一旦level11に落として回避…。あらかた出来たのでリポジトリに追加ITPバグも登録してアップロードした(この間にupstreamのバージョンが1.5.3から1.5.4に上がってギョッとした)。NEW queue通るのはずっと先だろうな…。


次はruby-dig-rbパッケージ。

$ gem2deb dig-rb  
dig-rb doesn't seem to exist. Let's try to download it with 'gem fetch dig-rb'
gem fetch dig-rb
ERROR:  Could not find a valid gem 'dig-rb' (>= 0) in any repository
ERROR:  Possible alternatives: dig_rb  
Failed to download .gem file

gemが見つからない?とおもったら「dig_rb」と_使ってるでやんの…指定し直し。

$ gem2deb dig_rb  
dig_rb doesn't seem to exist. Let's try to download it with 'gem fetch dig_rb'
gem fetch dig_rb
Fetching: dig_rb-1.0.1.gem (100%)
Downloaded dig_rb-1.0.1
(snip)
-- Debian package successfully built!

素晴らしい、無事変換できた。


次に無いのはruby-serverengineパッケージ。

pbuilder-satisfydepends-dummy : Depends: ruby-sigdump (>= 0.2.2) which is a virtual package and is not provided by any available package

gem2deb sigdumpで対応、basecowに入れておく。

$ sudo cp -arp /var/cache/pbuilder/base.cow /var/cache/pbuilder/ruby.cow
$ sudo cp ruby-sigdump_0.2.4-1_all.deb /var/cache/pbuilder/ruby.cow/tmp
$ sudo cowbuilder --login --basepath /var/cache/pbuilder/ruby.cow --save-after-exec
# apt install /tmp/ruby-sigdump_0.2.4-1_all.deb
$ sudo cowbuilder --build --basepath /var/cache/pbuilder/ruby.cow/ ruby-serverengine_2.1.0-1.dsc

で、パッケージバージョンでエラーになったのでこんなふうにしてみた。

--- a/serverengine.gemspec
+++ b/serverengine.gemspec
@@ -21,8 +21,8 @@
   gem.add_dependency "sigdump", ["~> 0.2.2"]

   # rake v12.x doesn't work with rspec 2. rspec should be updated to 3
-  gem.add_development_dependency "rake", ["~> 11.0"]
-  gem.add_development_dependency "rspec", ["~> 2.13.0"]
+  gem.add_development_dependency "rake"
+  gem.add_development_dependency "rspec"

   gem.add_development_dependency 'rake-compiler-dock', ['~> 0.5.0']
   gem.add_development_dependency 'rake-compiler', ['~> 0.9.4']

でもやっぱりエラー。

Could not find gem 'rake-compiler-dock (~> 0.5.0)' in any of the gem sources listed in your Gemfile.

あー。ないね。

$ gem2deb rake-compiler-dock
(snip)
7 tests, 21 assertions, 5 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
28.5714% passed

エラーログを見る。

TestEnvironmentVariables:
  test_HOST_RUBY_PLATFORM:  Docker is not available.

これは難儀そう…とdebian/controlを眺めると「Easy to use and reliable cross compiler environment for building Windows and Linux binary gems.」との説明文。ということはこれ、要らないのでは?外す。

Could not find gem 'rake-compiler (~> 0.9.4)' in any of the gem sources listed in your Gemfile.
Package: rake-compiler
Version: 1.0.5-1

なんだよもー。これもバージョン外してやってみよう。

/usr/bin/ruby2.5 /usr/bin/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation failed
ERROR: Test "ruby2.5" failed. Exiting.
dh_auto_install: dh_ruby --install /build/ruby-serverengine-2.1.0/debian/ruby-serverengine returned exit code 1
make: *** [debian/rules:6: binary] Error 1

うーん、どこかのテストがエラーになるな。1個ずつやってみよう。。。。あれ、エラー吐いてるのにテストが問題ないとなるのもあるね…。

ServerEngine::Supervisor
  initialize error
  when :log=IO option is given
I, [2019-04-03T14:37:32.253000 #27406]  INFO -- : Received graceful stop
    can start
  when :logger option is given
I, [2019-04-03T14:37:33.055374 #27406]  INFO -- : Received graceful stop
    uses specified logger instance
  when both :logger and :log options are given
I, [2019-04-03T14:37:33.857608 #27406]  INFO -- : Received graceful stop
    start ignoring :log
  when using signal as command_sender
I, [2019-04-03T14:37:34.664887 #27574]  INFO -- : Received graceful stop
I, [2019-04-03T14:37:34.862993 #27406]  INFO -- : Server finished with status 0
    start and graceful stop
I, [2019-04-03T14:37:35.671015 #27594]  INFO -- : Received immediate stop
I, [2019-04-03T14:37:35.870587 #27406]  INFO -- : Server finished with status 0
    immediate stop
I, [2019-04-03T14:37:36.678895 #27615]  INFO -- : Received graceful restart
I, [2019-04-03T14:37:37.477583 #27615]  INFO -- : Received graceful stop
I, [2019-04-03T14:37:37.879210 #27406]  INFO -- : Server finished with status 0
    graceful restart
I, [2019-04-03T14:37:38.686002 #27654]  INFO -- : Received immediate restart
I, [2019-04-03T14:37:39.489342 #27654]  INFO -- : Received graceful stop
I, [2019-04-03T14:37:39.886976 #27406]  INFO -- : Server finished with status 0
    immediate restart
I, [2019-04-03T14:37:40.691983 #27688]  INFO -- : Received reload
I, [2019-04-03T14:37:40.692981 #27688]  INFO -- : Received graceful stop
I, [2019-04-03T14:37:40.892738 #27406]  INFO -- : Server finished with status 0
    reload
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:195:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:41.398888 #27406]  INFO -- : Server finished unexpectedly with status 1
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:307:in `reboot_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:208:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:42.401104 #27406]  INFO -- : Server finished unexpectedly with status 1
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:307:in `reboot_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:208:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:43.400219 #27406]  INFO -- : Server finished with status 1
    auto restart in limited ratio
  when using pipe as command_sender
I, [2019-04-03T14:37:44.204850 #27757]  INFO -- : Received graceful stop
#<Thread:0x000055ddba860f40@/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:81 run> terminated with exception (report_on_exception is true):
/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:83:in `block in install_signal_handlers': undefined method `chomp' for nil:NilClass (NoMethodError)
I, [2019-04-03T14:37:44.408173 #27406]  INFO -- : Server finished with status 0
    start and graceful stop
I, [2019-04-03T14:37:45.215304 #27780]  INFO -- : Received immediate stop
#<Thread:0x000055ddba97e760@/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:81 run> terminated with exception (report_on_exception is true):
/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:83:in `block in install_signal_handlers': undefined method `chomp' for nil:NilClass (NoMethodError)
    immediate stop
I, [2019-04-03T14:37:45.414819 #27406]  INFO -- : Server finished with status 0
I, [2019-04-03T14:37:46.220865 #27799]  INFO -- : Received graceful restart
I, [2019-04-03T14:37:47.024452 #27799]  INFO -- : Received graceful stop
#<Thread:0x000055ddba9fa6f8@/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:81 run> terminated with exception (report_on_exception is true):
/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:83:in `block in install_signal_handlers': undefined method `chomp' for nil:NilClass (NoMethodError)
I, [2019-04-03T14:37:47.421282 #27406]  INFO -- : Server finished with status 0
    graceful restart
I, [2019-04-03T14:37:48.227456 #27837]  INFO -- : Received immediate restart
I, [2019-04-03T14:37:49.029153 #27837]  INFO -- : Received graceful stop
#<Thread:0x000055ddbaaa8af0@/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:81 run> terminated with exception (report_on_exception is true):
/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:83:in `block in install_signal_handlers': undefined method `chomp' for nil:NilClass (NoMethodError)
I, [2019-04-03T14:37:49.429525 #27406]  INFO -- : Server finished with status 0
    immediate restart
I, [2019-04-03T14:37:50.238952 #27872]  INFO -- : Received reload
I, [2019-04-03T14:37:50.240958 #27872]  INFO -- : Received graceful stop
#<Thread:0x000055ddba9cc2a8@/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:81 run> terminated with exception (report_on_exception is true):
/build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:83:in `block in install_signal_handlers': undefined method `chomp' for nil:NilClass (NoMethodError)
I, [2019-04-03T14:37:50.439080 #27406]  INFO -- : Server finished with status 0
    reload
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:195:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:50.943666 #27406]  INFO -- : Server finished unexpectedly with status 1
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:307:in `reboot_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:208:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:51.944788 #27406]  INFO -- : Server finished unexpectedly with status 1
Unexpected error error test
  /build/ruby-serverengine-2.1.0/spec/server_worker_context.rb:223:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/worker.rb:81:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/embedded_server.rb:26:in `run'
  /build/ruby-serverengine-2.1.0/lib/serverengine/server.rb:128:in `main'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:269:in `block in start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:134:in `block in fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/process_manager.rb:126:in `fork'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:260:in `start_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:307:in `reboot_server'
  /build/ruby-serverengine-2.1.0/lib/serverengine/supervisor.rb:208:in `main'
  /build/ruby-serverengine-2.1.0/spec/supervisor_spec.rb:10:in `block in start_supervisor'
I, [2019-04-03T14:37:52.946855 #27406]  INFO -- : Server finished with status 1
    auto restart in limited ratio


1 deprecation warning total
Deprecation Warnings:

Finished in 24.13 seconds (files took 0.26415 seconds to load)
28 examples, 0 failures
ServerEngine::MultiThreadServer
I, [2019-04-03T14:44:36.057152 #3330]  INFO -- : Received reload
I, [2019-04-03T14:44:37.558054 #3330]  INFO -- : Received graceful stop
  scale up
I, [2019-04-03T14:44:38.560735 #3330]  INFO -- : Received graceful restart
I, [2019-04-03T14:44:40.061600 #3330]  INFO -- : Received graceful stop
  scale down
/usr/bin/ruby2.5 /usr/bin/rspec --pattern ./spec/\*\*/multi_process\*_spec.rb --format documentation failed
ERROR: Test "ruby2.5" failed. Exiting.

spec/multi_process_server_spec.rbがコケてる

    it 'raises SystemExit when all workers exit with specified code by unrecoverable_exit_codes' do
      pending "unrecoverable_exit_codes supported only for multi process workers" if impl_class == ServerEngine::MultiThreadServer
      pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

      config = {workers: 4, log_stdout: false, log_stderr: false, unrecoverable_exit_codes: [3, 4, 5]}

      s = impl_class.new(TestExitWorker) { config.dup }
      raised_error = nil
      t = Thread.new do
        begin
          s.main
        rescue SystemExit => e
          raised_error = e
        end
      end

      wait_for_fork
      test_state(:worker_run).should == 4
      t.join

      test_state(:worker_stop).to_i.should == 0
      raised_error.status.should == 3 # 4th process's exit status
    end

    it 'raises SystemExit immediately when a worker exits if stop_immediately_at_unrecoverable_exit specified' do
      pending "unrecoverable_exit_codes supported only for multi process workers" if impl_class == ServerEngine::MultiThreadServer
      pending "Windows environment does not support fork" if ServerEngine.windows? && impl_class == ServerEngine::MultiProcessServer

      config = {workers: 4, log_stdout: false, log_stderr: false, unrecoverable_exit_codes: [3, 4, 5], stop_immediately_at_unrecoverable_exit: true}

      s = impl_class.new(TestExitWorker) { config.dup }
      raised_error = nil
      t = Thread.new do
        begin
          s.main
        rescue SystemExit => e
          raised_error = e
        end
      end

      wait_for_fork
      test_state(:worker_run).should == 4
      t.join

      test_state(:worker_stop).to_i.should == 3
      test_state(:worker_finished).to_i.should == 3
      raised_error.should_not be_nil
      raised_error.status.should == 5 # 1st process's exit status
    end

うーん。とりあえず該当のテストを無効にしておくか。


めんてなのおしごと

Tue, Apr 2, 2019  in debian debian


めんてなのおしごと

Sun, Mar 31, 2019  in debian debian



jcodingsのunblockを出した



先日、ミラーアーカイブからDebian7とDebian8のサポート終了コンポーネントが削除されました。すると、Docker使ってる人やCircleCI使ってる人が「ぎゃー!」と叫び始めたという。どうも背景を理解されてる方は少ないようなので、簡単にざっと説明を書きました(ユーザーならともかく、イメージを提供するベンダー側は把握しておいてほしいですけどね…)。

ベースイメージとしてDebian8 “jessie"を使っているという前提で話をします。

  • Debian8はDebian9のリリースに伴って「oldstable」(旧安定版)という扱いになっています。oldstableはstableに比べて限定されたサポートの提供となります。そりゃぁでっかいリポジトリを複数バージョンに渡って長期間メンテナンスなんて難しいですからね。oldstable使ってる時点で色々制限が出てくる、ってもんです。ベストプラクティスとしては「ベースイメージのDebianはstableを使おう」です。
    • え?Ubuntu LTSだってでっかいリポジトリで長期間サポートしてるじゃん、って?…彼らは2000パッケージぐらいのmainコンポーネントはサポートしてるけど、その他の50000パッケージぐらいのuniverseはコミュニティに寄るサポート≒Debianその他から持ってくるよ、という状態なんですよ。知らなかったでしょ?
  • jessie-updatesコンポーネントが無くてビルドがー!という人:-updatesは「stableにおけるパッケージのうち、定期的な更新が必要なものを提供」という位置づけなので、jessieがoldstableになった時点で死んでます。外しちゃえばいいです。
  • (追記) http://security.debian.org/debian-security jessie/updates mainも削除…はしちゃダメです! その行はセキュリティアップデートの取得です(取得先サーバーがsecurity.debian.orgでしょ?) たしかにjessie/updatesというところだけを見たら削除したくなるかもしれませんが、LTSサポートのセキュリティアップデートが降ってくるのを消したらアカンですよ…。
  • jessie-backportsが無くなってギャー!という人:-backportsは「stableへの新しいバージョンの移植」という位置づけのコンポーネントなので、jessieがoldstableになった時点で死んでます。なんで使ってんの?ということです。そもそも新しいバージョンが必要だ、というならoldstable使ってる時点で前提がおかしいですよ?まずはstableに移行しましょう

Debian9がでて早2年近く、そろそろDebian10の足音も聞こえてるので、開発側としてはいまさらDebian8に固執してほしくはない、というのが正直な所。ベースイメージのバージョン移行は計画的に…。



  • tomoyo-toolsも一応unblockを出した。通らないかもしれないけど、一応そこまでdiffがでかくないよ―というアピール。
    • →ダメだった。そらそーか。
  • squid-deb-proxyは問い合わせてみたが特に反応がないが、週末だったので--deleyed 3でアップロードした。