view · edit · sidebar · attach · print · history

Index>

20141201-cannot-login-after-paying-with-paypal

Summary

  • User was asked to pay after a successfull payment with paypal
  • Merge medreg into master
  • compare xls from medreg and xml from refdata

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!

---

compare xls from medreg and xml from refdata

Created helper scripts to download xlsx (Attach:get_xls.rb) and xml (Attach:get_xml.rb) from medreg, resp. refdata.

Merge medreg into master

Merged medreg branch into master. Various Watir tests show error, eg. zsr_spec.rb. Eg. visiting http://oddb-ci2.dyndns.org/de/gcc/zsr/J039019 gives error ArgumentError Invalid URL:

Here the list of failing watir-tests

rspec ./spec/admin_spec.rb:128 # ch.oddb.org should be possible to create a CompanyUser
rspec ./spec/doctors_spec.rb:64 # ch.oddb.org check doctors
rspec ./spec/interactions_spec.rb:116 # ch.oddb.org should show both interaction direction for marcoumar and ponstan
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Ponstan Marcoumar Aspirin
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Ponstan Aspirin Marcoumar
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Marcoumar Ponstan Aspirin
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Marcoumar Aspirin Ponstan
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Aspirin Ponstan Marcoumar
rspec ./spec/interactions_spec.rb:141 # ch.oddb.org should show all interactions for Aspirin Marcoumar Ponstan
rspec ./spec/interactions_spec.rb:220 # ch.oddb.org should show interactions in the correct order just below the triggering drug
rspec ./spec/interactions_spec.rb:243 # ch.oddb.org should show interactions having given iksnr,ean13,atc_code,iksnr
rspec ./spec/interactions_spec.rb:252 # ch.oddb.org should show interactions having given atc_codes
rspec ./spec/interactions_spec.rb:257 # ch.oddb.org should show interactions having given ean13s
rspec ./spec/interactions_spec.rb:262 # ch.oddb.org should show interactions having given iksnrs
rspec ./spec/interactions_spec.rb:267 # ch.oddb.org should show interactions for epha example medicaments added manually
rspec ./spec/pharmacies_spec.rb:52 # ch.oddb.org check pharmacy
rspec ./spec/preferences_spec.rb:16 # ch.oddb.org should save zsr in preferences
rspec ./spec/rezept_and_instantsearch_spec.rb:250 # ch.oddb.org should be possible to add drugs after delete_all when ZSR is given but no comment
rspec ./spec/rezept_and_instantsearch_spec.rb:270 # ch.oddb.org should be possible to add drugs after delete_all when no ZSR is given but a comment
rspec ./spec/rezept_and_instantsearch_spec.rb:290 # ch.oddb.org should be possible to add drugs after delete_all when ZSR and comment given
rspec ./spec/rezept_and_instantsearch_spec.rb:311 # ch.oddb.org should possible to add first medicament by trademark search, then using instant
rspec ./spec/rezept_and_instantsearch_spec.rb:334 # ch.oddb.org after a delete_all it must be possible to add drugs
rspec ./spec/rezept_and_instantsearch_spec.rb:353 # ch.oddb.org should print a correct prescription with comments, personal information, doctor info and a drug
rspec ./spec/rezept_and_instantsearch_spec.rb:378 # ch.oddb.org should contain remarks or interaction header only when present
rspec ./spec/rezept_and_instantsearch_spec.rb:397 # ch.oddb.org should print the fachinfo when opening the fachinfo from a prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:416 # ch.oddb.org should enable to go back after printing a prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:429 # ch.oddb.org should not loose existing comment after adding a new prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:441 # ch.oddb.org should show the interaction between different drugs
rspec ./spec/rezept_and_instantsearch_spec.rb:459 # ch.oddb.org should with four medicaments
rspec ./spec/rezept_and_instantsearch_spec.rb:486 # ch.oddb.org should show the correct url after deleting a medicament
rspec ./spec/rezept_and_instantsearch_spec.rb:548 # ch.oddb.org should be possible to print a presciption with 10 drugs
rspec ./spec/searchbar_spec.rb:85 # ch.oddb.org should be possible to find 1,25-Dihydroxycholecalciferol when searching via 125 in analysen
rspec ./spec/searchbar_spec.rb:85 # ch.oddb.org should be possible to find 1,25-Dihydroxycholecalciferol when searching via 125Dihydroxycholecalciferol in analysen
rspec ./spec/searchbar_spec.rb:167 # ch.oddb.org should be possible to find Abacavir via Wirkstoffe
rspec ./spec/zsr_spec.rb:35 # ch.oddb.org should work with J039019

Interactions failed because, the epha interactions were not loaded correctly. sudo rm /var/www/oddb.org/data/csv/interactions_* and restarting oddbd fixed this problem. Pushed commits

rezept_and_instantsearch_spec.rb fail because the ZSR cannot be fetched. Wrote an e-mail to Philipp to diagnose this problem. Using savon 2.8 still gives errors when calling

irb(main):001:0> require 'savon'
=> true
irb(main):002:0> Savon::VERSION
=> "2.8.0"
irb(main):003:0> Savon.client(wsdl: 'https://www.pharmedsolutions.ch/ZSRService/wsdl').operations
Wasabi::Resolver::HTTPError: Error: 303
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/resolver.rb:45:in `load_from_remote'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/resolver.rb:33:in `resolve'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/document.rb:142:in `xml'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/document.rb:160:in `parse'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/document.rb:147:in `parser'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/wasabi-3.3.0/lib/wasabi/document.rb:64:in `soap_actions'
        from /home/niklaus/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/savon-2.8.0/lib/savon/client.rb:28:in `operations'
        from (irb):4
        from /home/niklaus/.rbenv/versions/1.9.3-p0/bin/irb:12:in `<main>'

After pulling and restart oddbd on thinpower I remarked that I had a left over require 'watir' in a src file. Removed with commit Remove unused import of watir in src/plugin/medreg_pharmacy.rb

Started a new screen import_pharmacy on thinpower. Started import via sudo -u apache /usr/local/bin/ruby jobs/import_regmed_pharmacies. Had to remove a stale log/job.pid from the import_daily jobs. Import_medreg_pharmacies started without problems. Had to restart the import after 900 pharmacies.

But my local import got stuck. The last few lines look like the following

2014-12-01 16:08:09 +0100:  MedregPharmacyPlugin Searching for company with GLN 7601001376410. Skipped 0, created 296 updated 2 of 3004).
2014-12-01 16:08:10 +0100:  MedregPharmacyPlugin {:ean13=>"7601001376410", :name=>"Pharmacie St-Victor SA", :plz=>"1227", :location=>"Carouge", :address=>"Rue Saint-Victor 24", :ba_type=>"öffentliche Apotheke", :narcotics=>"6011 Verzeichnis a/b/c BetmVV-EDI", :addresses=>[#<ODDB::Address2:0x00000005fe6640 @revision=2014-12-01 16:08:10 +0100, @odba_id=32374715, @oid=32374715, @additional_lines=[], @fon=[], @fax=[], @name="Pharmacie St-Victor SA", @address="Rue Saint-Victor 24", @location="1227 Carouge">]}
2014-12-01 16:08:10 +0100:  MedregPharmacyPlugin   created #<ODDB::Company:0x00000006f10530> 
RuntimeError: can't modify frozen String when updating index 'company_index' with a ODDB::Company
["/var/www/oddb.org/src/util/searchterms.rb:91:in `force_encoding'", "/var/www/oddb.org/src/util/searchterms.rb:91:in `block in search_terms'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `each'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `inject'"]
[...]

RuntimeError: can't modify frozen String when updating index 'atc_index_company' with a ODDB::Company
["/var/www/oddb.org/src/util/searchterms.rb:91:in `force_encoding'", "/var/www/oddb.org/src/util/searchterms.rb:91:in `block in search_terms'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `each'", "/var/www/oddb.org/src/util/searchterms.rb:87:in `inject'"]
[...]

2014-12-01 16:08:10 +0100:  MedregPharmacyPlugin store_company updated 7601001376410 oid 32374717  create in database. pointer nil ba_type ba_public_pharmacy. Have now 2072 companies.
2014-12-01 16:08:10 +0100:  MedregPharmacyPlugin Start saving @app.companies.odba_store 7601001376410 after 297 created 2 updated
2014-12-01 16:08:10 +0100:  MedregPharmacyPlugin Searching for company with GLN 7601001376427. Skipped 0, created 297 updated 2 of 3004).
2014-12-01 16:08:11 +0100:  MedregPharmacyPlugin {:ean13=>"7601001376427", :name=>"Farmacia Sole", :plz=>"6600", :location=>"Locarno", :address=>"Via Luini - Stabile la Ferriera", :ba_type=>"öffentliche Apotheke", :narcotics=>"6011 Verzeichnis a/b/c BetmVV-EDI", :addresses=>[#<ODDB::Address2:0x000000089b97b0 @revision=2014-12-01 16:08:11 +0100, @odba_id=32374719, @oid=32374719, @additional_lines=[], @fon=[], @fax=[], @name="Farmacia Sole", @address="Via Luini - Stabile la Ferriera", @location="6600 Locarno">]}
2014-12-01 16:08:11 +0100:  MedregPharmacyPlugin   created #<ODDB::Company:0x00000008fadd60> 

With the second run, all pharmacies were imported. Searching e.g. via Kriens does not work, but search the pharmacy via GLN 7610840000042 worked. Will investigate tomorrow.

User was asked to pay after a successfull payment with paypal)

Zeno reports a case that a user was asked to pay (after 5 requests) even when he had payed with paypal before. Rebooting did not help. User is using Firefox on Mac.

Found in the logs a password reset

2014-11-28 18:12:45 CETUtil.send_mail list_and_recipients ["user_mail", "password_lost"]
2014-11-28 18:12:45 CET Util.log_and_deliver_mail to=["user_mail", "zdavatz@ywesee.com"] subject ODDB.org / Generika.cc Lost password size 295 with 0 attachments. Dear user
http://ch.oddb.org/en/gcc/password_reset/token/HASH/email/user_mail

Could reproduce the problem with this username on ch.oddb.org. Checking for log entries under /service/yusd/log/main. I did not find any grant entries for this use only [2014-11-28T18:12:45.858009 #2323] INFO -- Yus::AutoSession: grant(name=user_mail, action=reset_password,

Looking at the error under generika (/var/www/oddb.org/log/generika/2014/11/error_log) brings up entries like

[Mon Dec 01 09:14:37 2014] [error] access to /de/generika/rss/channel/sl_introduction.rss failed for (null), reason: Mon Dec 01 09:14:37 +0100 2014 - 69824478099680 - Errno::ENOENT - No such file or directory - /var/www/oddb.org/data/rss/de/sl_introduction-generika.rss

[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: Fri Nov 28 18:23:25 +0100 2014 - 69824479096760 - DRb::DRbConnError - druby://localhost:10008 - #<Errno::ECONNREFUSED: Connection refused - connect(2)>  
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:736:in `open'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:729:in `each'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:729:in `open'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1189:in `initialize'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1169:in `new'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1169:in `open'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1085:in `method_missing'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1103:in `with_friend'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/drb/drb.rb:1084:in `method_missing'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/cgi/drbsession.rb:20:in `initialize'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/cgi/session.rb:273:in `new'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/cgi/session.rb:273:in `initialize'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:88:in `new'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:88:in `drb_process'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb:61:in `process'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /var/www/oddb.org/doc/index.rbx:21
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Fri Nov 28 18:23:25 2014] [error] access to /dt/generika/show/reg/47346/seq/02/currency/USD failed for (null), reason: /usr/lib64/ruby/1.8/apache/ruby-run.rb:53:in `handler'
[Fri Nov 28 18:23:26 2014] [error] access to /dt/generika/patinfo/reg/56018/seq/01/currency/USD failed for (null), reason: Fri Nov 28 18:23:26 +0100 2014 - 69824478085120 - DRb::DRbConnError - druby://localhost:10008 - #<Errno::ECONNREF

Port 10008 is for google crawler, therefore probably unrelated to our problem. When trying to reproduce the problem under http://generika.cc/ I could ask more than five request without being asked for a password.

Testing whether the user in question really got the requested grants (src/util/ipn.rb, shows that he/she should get

        system.yus_set_preference(yus_name, 'poweruser_duration', invoice.max_duration)
        system.yus_grant(yus_name, 'login', 'org.oddb.PowerUser')
        system.yus_grant(yus_name, 'view', 'org.oddb', item.expiry_time)

Testing in bin/admin with

h.oddb> yus_allowed?(name,  'login', 'org.oddb.PowerUser')
-> false
ch.oddb> yus_allowed?(name,  'view', 'org.oddb')
-> false
view · edit · sidebar · attach · print · history
Page last modified on December 01, 2014, at 05:51 PM