From: Daniel Berger Date: 2005-07-12T01:38:14+09:00 Subject: Strange logger rotation failure Hi all, Ruby 1.8.2 Solaris 10 I have a couple Ruby scripts running via cron that connect to an Oracle database and execute some stored procedures - nothing fancy. On Saturday, July 2, 2005, the logger package spewed a strange error at me: Your "cron" job on itwsp193910wss log_cleanup_dev.rb produced the following output: /usr/local/lib/ruby/1.8/logger.rb:516:in `write': Shifting failed. 'log_cleanup_dev.log.20050630' already exists. (Logger::ShiftingError) from /usr/local/lib/ruby/1.8/logger.rb:318:in `add' from /usr/local/lib/ruby/1.8/logger.rb:399:in `fatal' from log_cleanup_dev.rb:68 First, a bit of background. There are two nearly identical scripts that run - one is log_cleanup.rb and the other is log_cleanup_dev.rb. The only difference between them is the database connect string (i.e. one connects to a production database, and the script in question connects to a dev database). The first curious thing to me is that this error was raised on July *2nd* (it also happened on July 8th, btw). The second (less) curious thing is that this was only raised by the dev script. It's less curious, because the reason the script failed in both instances was because the DBA was doing some maintenance on the dev database on those mornings. # Relevant snippet from log_cleanup_dev.rb (line 68 noted): # Logger instance log = Logger.new("log_cleanup_dev.log", "monthly") # and later... begin sth = dbh.prepare("begin my_proc; end;") sth.execute rescue DBI::Error => e msg = "Error executing stored procedure 'my_proc': #{e.errstr}" log.fatal{ msg } # Line 68 raise rescue => e msg = "Unexpected error executing stored procedure 'my_proc': #{e}" log.fatal{ msg } raise ensure sth.finish if sth end Any ideas? It looks to me like it's trying to rotate when it shouldn't or something, but I haven't dug too deeply into this yet. Regards, Dan