view · edit · sidebar · attach · print · history

Index>

20141111-SL-Udate-without-text

Summary

  • SL-Update comes with attachement but without explanation

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!

---

SL-Update comes with attachement but without explanation

My patch had not the expected effect and failed.

Looking at the log I find an unexepected error

failsafe rescued TypeError < StandardError
0 is not a symbol
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:122:in `respond_to?'
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:122:in `respond_to?'
/var/www/oddb.org/src/util/persistence.rb:284:in `block in resolve'
/var/www/oddb.org/src/util/persistence.rb:278:in `each'
/var/www/oddb.org/src/util/persistence.rb:278:in `resolve'
/var/www/oddb.org/src/util/persistence.rb:208:in `issue_create'
/var/www/oddb.org/src/util/oddbapp.rb:110:in `block in create'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:109:in `create'
/var/www/oddb.org/src/util/persistence.rb:288:in `block in resolve'
/var/www/oddb.org/src/util/persistence.rb:278:in `each'
/var/www/oddb.org/src/util/persistence.rb:278:in `resolve'
/var/www/oddb.org/src/util/persistence.rb:256:in `issue_update'
/var/www/oddb.org/src/util/oddbapp.rb:131:in `block in update'
/var/www/oddb.org/src/util/failsafe.rb:10:in `call'
/var/www/oddb.org/src/util/failsafe.rb:10:in `failsafe'
/var/www/oddb.org/src/util/oddbapp.rb:129:in `update'
/var/www/oddb.org/src/util/oddbapp.rb:1540:in `update'
/var/www/oddb.org/src/plugin/bsv_xml.rb:427:in `block in tag_end'
/var/www/oddb.org/src/plugin/bsv_xml.rb:400:in `each'
/var/www/oddb.org/src/plugin/bsv_xml.rb:400:in `tag_end'
/usr/local/lib/ruby/1.9.1/rexml/parsers/streamparser.rb:26:in `parse'
/usr/local/lib/ruby/1.9.1/rexml/document.rb:205:in `parse_stream'
/var/www/oddb.org/src/plugin/bsv_xml.rb:1011:in `update_preparations'
/var/www/oddb.org/src/plugin/bsv_xml.rb:663:in `block (2 levels) in _update'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry.rb:500:in `get_input_stream'
/var/www/oddb.org/src/plugin/bsv_xml.rb:663:in `block in _update'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:42:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:42:in `block in each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:41:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/entry_set.rb:41:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/central_directory.rb:182:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:139:in `block in foreach'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:99:in `open'
/usr/local/lib/ruby/gems/1.9.1/gems/rubyzip-1.1.6/lib/zip/file.rb:138:in `foreach'
/var/www/oddb.org/src/plugin/bsv_xml.rb:658:in `_update'
/var/www/oddb.org/src/plugin/bsv_xml.rb:653:in `update'
/var/www/oddb.org/src/util/updater.rb:250:in `block in update_bsv'
/var/www/oddb.org/src/util/updater.rb:502:in `call'
/var/www/oddb.org/src/util/updater.rb:502:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:249:in `update_bsv'
jobs/import_bsv:14: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'
jobs/import_bsv:12:in `<module:Util>'
jobs/import_bsv:11:in `<module:ODDB>'
jobs/import_bsv:10:in `<main>'

Added more debug info into bsv_xml and mail. Restarting import. Still the same problem.

Running onyl bsv_followers with oddb.csv which has the same problem and is much faster. Using pry and single-stepping I remarked that in real life (not unit-tests) the body does not get transmitted when attachments are used. May be I must use mail.preamble (before first attachement).

Sending attachements and a body seems not be so easy. Trying various stuff. Fortunately I am able to use pry on oddb-ci2.

Debugging and trying various stuff showed, that this code works

Mail.deliver do
  from     override_from ? override_from : Util.mail_from
  to       Util.check_and_get_all_recipients(list_and_recipients)
  subject  'Here is the image you wanted'
  body     File.read('/etc/group')
  add_file '/etc/hosts'
end

and this one failed

Mail.deliver do
  from     override_from ? override_from : Util.mail_from
  to       Util.check_and_get_all_recipients(list_and_recipients)
  subject  'Here is the image you wanted'
  body     File.read('/etc/group')
  add_file '/etc/hosts'
end

also this one failed

Mail.deliver do
  from     override_from ? override_from : Util.mail_from
  to       Util.check_and_get_all_recipients(list_and_recipients)
  subject  'Here is the image you wanted'
  body.preamble = 'test-body'
  add_file '/etc/hosts'
end

All alternatives was stuff I considered legal after reading https://github.com/mikel/mail. This is in version 2.6.3. Our mail version is 2.2.7. Testing my code after installing mail 2.6.3.

Finally fixed the problem with commit Added unit test for src/util/log.rb and more debugging info.

view · edit · sidebar · attach · print · history
Page last modified on November 11, 2014, at 04:23 PM