zdavatz / oddb.org

Open Drug Database for Switzerland
https://ch.oddb.org
GNU General Public License v3.0
10 stars 8 forks source link

nothing happens when running `jobs/update_refdata` #156

Closed zdavatz closed 2 years ago

zdavatz commented 2 years ago
  1. After the downgrade back to Ruby 3.0.0 nothing happens when running bsv_followers.
  2. https://github.com/zdavatz/oddb.org/issues/155#issuecomment-1084260738
  3. Looks like this leads to nowhere: sudo -u apache bundle-300 exec ruby-300 jobs/update_refdata.
  4. No output is coming.
  5. XMLRefdataPharma-latest.xml has not been downloaded since 6.1.2022
  6. Also see: https://github.com/zdavatz/oddb.org/issues/151#issuecomment-1030233286
ngiger commented 2 years ago

on thinpower the commit 79ae1057ce6f9208279774494ef86fb24d68aebd "(#151) Use https for refdata update companies and persons" is missing.

zdavatz commented 2 years ago

So https is not working for the Pharma download yet?

ngiger commented 2 years ago

Nein, das ist für refdata_nat und refdata_jur (aka persons and companies)

zdavatz commented 2 years ago

Ok, wir brauchen es auch für Pharma.

ngiger commented 2 years ago

Auf thinpower findet man -rw-r--r-- 1 apache apache 3460 1. Apr 18:42 /var/www/oddb.org/log/oddb/debug/update_package_trade_status.log und via

tail /var/www/oddb.org/log/oddb/debug/update_package_trade_status.log
0,0,0,0 7680669030025   27 / 20188      Estimate total: 202.71 [h] It will be done in: 202.44 [h]
0,0,0,0 7680667700012   28 / 20188      Estimate total: 201.49 [h] It will be done in: 201.21 [h]
0,0,0,0 7680669970017   29 / 20188      Estimate total: 200.36 [h] It will be done in: 200.07 [h]
0,0,0,0 7680669970024   30 / 20188      Estimate total: 199.30 [h] It will be done in: 199.00 [h]
0,0,0,0 7680662610019   31 / 20188      Estimate total: 198.30 [h] It will be done in: 198.00 [h]
0,0,0,0 7680662610040   32 / 20188      Estimate total: 197.37 [h] It will be done in: 197.06 [h]
0,0,0,0 7680662610057   33 / 20188      Estimate total: 196.50 [h] It will be done in: 196.18 [h]
0,0,0,0 7680667860013   34 / 20188      Estimate total: 195.68 [h] It will be done in: 195.35 [h]
0,0,0,0 7680664470017   35 / 20188      Estimate total: 194.90 [h] It will be done in: 194.56 [h]
0,0,0,0 7680664470024   36 / 20188      Estimate total: 194.17 [h] It will be done in: 193.82 [h]

Aus irgendeinem Grund ist import extrem langsam geworden. Weshalb?

zdavatz commented 2 years ago

Kann die Datei XMLRefdataPharma jetzt runtergeladen werden?

ngiger commented 2 years ago

Nein, der code funktioniert hier anders. Siehe ext/refdata/src/refdata.rb. Es wird immer nur nach einem GTIN gesucht via:

ngiger commented 2 years ago

XMLRefdataPharma kommt via src/plugin/atc_less.rb hinein, was beim update_swissmedic_followers (nicht aber aber bei bsv_followers) noch vor dem update_package_trade_status_by_refdata kommt.

zdavatz commented 2 years ago

Ok, aber trotzdem wird XMLRefdataPharma nicht mehr runtergeladen?

ngiger commented 2 years ago

Starte im screen import_swissmed sudo -u apache bundle-300 exec ruby-300 jobs/update_atc_less. Dann sollte das bald mal kommen.

zdavatz commented 2 years ago

Wozu brauchen wir den Job update_refdata? Der war doch nur dazu da, um den Pharmacode zu holen, oder?

zdavatz commented 2 years ago

Ok, XMLRefdataPharma wurde nicht runtergeladen und es kommt folgender Error:

INDEX CREATION ERROR:
undefined method `load_documents' for Psych:Module
Did you mean?  load_stream
/var/www/oddb.org/src/util/oddbapp.rb:1355:in `rebuild_indices'
/var/www/oddb.org/src/util/oddbapp.rb:1497:in `block in method_missing'
/var/www/oddb.org/src/util/oddbapp.rb:1496:in `synchronize'
/var/www/oddb.org/src/util/oddbapp.rb:1496:in `method_missing'
/var/www/oddb.org/src/plugin/atc_less.rb:189:in `update_atc_codes'
/var/www/oddb.org/src/util/updater.rb:504:in `update_immediate'
/var/www/oddb.org/src/util/updater.rb:401:in `update_atc_less'
jobs/update_atc_less:14:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:41:in `run'
jobs/update_atc_less:12:in `<module:Util>'
jobs/update_atc_less:11:in `<module:ODDB>'
jobs/update_atc_less:10:in `<main>'
ngiger commented 2 years ago

Habe dieses Problem von Hand auf thinpower geflickt und jobs/update_atc_less neu gestartet. Ich glaube, dieser Fehler tritt nicht auf, wenn atc_less via swissmedic_followers aufgerufen wird.

zdavatz commented 2 years ago

Ich denke nicht, denn ich habe atc_less nie alleine laufen lassen, seit Januar 2022. Ich sehe noch keine runtergeladene Datei XMLRefdataPharma. Ah, Du meinst den INDEX CREATION ERROR.

ngiger commented 2 years ago

Sorry, atc_less liest nur das XMLRefdataPharma-latest.xml aus. Generiert wird es im ext/refdata/src/refdata.src in der Prozedure historize.

Placing a few pry debug statement and restarting the ext/refdata/bin/refdatad and jobs/update_refdata.

ngiger commented 2 years ago

This should be fixed with commit https://github.com/ngiger/oddb.org/commit/5beccc6fe883881d73a8ea4e72cc6b6d2e5591da "(#156) Use https to fetch refdata articles. Better logging".

On thinpower restarted jobs/import_bsv_followers (in screen import_bsv)