<< | Index | >>
The export price_history.csv, doctors.csv gave the last few days always
Error: ArgumentError Message: invalid byte sequence in US-ASCII
Last week I ran manually the command sudo -u apache /var/www/oddb.org/jobs/export_daily
.
To catch the error I will do the following.
1 2 * * * apache /var/www/oddb.org/jobs/export_daily >/var/log/export_daily.log >&1
* * * * * apache /bin/env > /var/log/crontab_env.log
in /etc/crontab. But I am still waiting for an output.
Output of running sudo -u apache export_daily like in last week produces
ENV ist {"TERM"=>"screen" LS"_COLORS"=>"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:" "PATH"=>"/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin" "LC_COLLATE"=>"C" "LANG"=>"de_CH.UTF-8" "HOME"=>"/root" "LANGUAGE"=>"de_CH.UTF-8" "SHELL"=>"/bin/bash" "LOGNAME"=>"apache" "USER"=>"apache" "USERNAME"=>"apache" "SUDO_COMMAND"=>"/var/www/oddb.org/jobs/export_daily" "SUDO_USER"=>"root" "SUDO_UID"=>"0" "SUDO_GID"=>"0"}
Very weird! Today I get the same errors invalid byte sequence in US-ASCII
when running it manually. Also I got the "Connect refused error" when restarting the server at the end.
I think I must (among other things) fix the error handling in safe_export to
Still getting a connection error, but export_daily finished without exiting with error.
Changed /service/ch.oddb-exporter/run to log to /var/log/exportd_ch.log to catch the error. Can't get output of the failing csv-export. Therefore dhanged ext/export/src/csv_exporter.rb to log each dump. Testing it on my VM. Had an error as logExport was not declared as CsvExporter.logExport. Will rerun test tomorrow.
In export of September 15 we got the following error mail "Error in export oddbdat"
Error: NoMethodError Message: undefined method `-' for nil:NilClass Backtrace: (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:143:in `block (2 levels) in lines' (druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:206:in `call' (druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:206:in `block in each_chapter' (druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:204:in `each' (druby://localhost:10005) /var/www/oddb.org/src/model/fachinfo.rb:204:in `each_chapter' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:138:in `block in lines' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `each' (druby://localhost:10005) /usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/oddbdat.rb:136:in `lines' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:190:in `block (2 levels) in export_oddbdat' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:189:in `each' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:189:in `block in export_oddbdat' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:187:in `each' (druby://localhost:10005) /var/www/oddb.org/ext/export/src/odba_exporter.rb:187:in `export_oddbdat' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' (druby://localhost:10005) /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop' /var/www/oddb.org/src/plugin/oddbdat_export.rb:144:in `export_fachinfos' /var/www/oddb.org/src/util/exporter.rb:196:in `block in export_oddbdat' /var/www/oddb.org/src/util/exporter.rb:425:in `call' /var/www/oddb.org/src/util/exporter.rb:425:in `safe_export' /var/www/oddb.org/src/util/exporter.rb:192:in `export_oddbdat' /var/www/oddb.org/src/util/exporter.rb:67:in `block in run' /var/www/oddb.org/src/util/schedule.rb:15:in `call' /var/www/oddb.org/src/util/schedule.rb:15:in `run_on_weekday' /var/www/oddb.org/src/util/exporter.rb:63:in `run' /var/www/oddb.org/jobs/export_daily:13:in `block in <module:Util>' /var/www/oddb.org/src/util/job.rb:40:in `call' /var/www/oddb.org/src/util/job.rb:40:in `run' /var/www/oddb.org/jobs/export_daily:12:in `<module:Util>' /var/www/oddb.org/jobs/export_daily:11:in `<module:ODDB>' /var/www/oddb.org/jobs/export_daily:10:in `<main>'
Copied the /etc/logrotate.d/rsyslog from my VM to thinpower, as I remarked, that /var/log/messages never got saved and was 1,5 GB big. Was very similar to the rsyslog on my Debian wheezy system. Ran manually /etc/cron.daily/logrotate to ensure that no problems occured. After running the script /var/log/messages was correctly rotatated.