zerebubuth / openstreetmap-license-change

Algorithm for OpenStreetMap ODbL transition.
18 stars 16 forks source link

undefined local variable or method `klass' #28

Open pnorman opened 10 years ago

pnorman commented 10 years ago

Overnight when redacting a decently largechangeset

Uploading 500 elements of 8675 total
DEP GET: http://www.openstreetmap.org/api/0.6/way/60446483
DEP GET: http://www.openstreetmap.org/api/0.6/way/60446483
DEP GET: http://www.openstreetmap.org/api/0.6/way/60446483
Failed to upload a changeset: undefined local variable or method `klass' for #<ServerDB:0x00000008563a30>
["redact_changeset.rb:227:in `get_obj'", "redact_changeset.rb:193:in `block (2 levels) in initialize'", "/home/pnorman/osm/redaction/openstreetmap-license-change/osm_print.rb:56:in `from_delete'", "/home/pnorman/osm/redaction/openstreetmap-license-change/osm_print.rb:46:in `block in print_osmchange'", "/home/pnorman/osm/redaction/openstreetmap-license-change/osm_print.rb:39:in `each'", "/home/pnorman/osm/redaction/openstreetmap-license-change/osm_print.rb:39:in `print_osmchange'", "redact_changeset.rb:243:in `process_changeset'", "redact_changeset.rb:481:in `block in <main>'", "redact_changeset.rb:479:in `each'", "redact_changeset.rb:479:in `each_slice'", "redact_changeset.rb:479:in `<main>'"]
pnorman commented 10 years ago

Note: it seems to of redacted correctly.

zerebubuth commented 10 years ago

Hmmm... I can't make those line numbers match up with anything. What commit is your working directory on?

pnorman commented 10 years ago

f2bf2a148eadd754eb20487965cc3edea77b9f7e:

commit f2bf2a148eadd754eb20487965cc3edea77b9f7e
Merge: a01e11e 1d5b41b
Author: Paul Norman <penorman@mac.com>
Date:   Wed Aug 29 21:59:52 2012 -0700

    Merge branch 'wip-412-fix' of https://github.com/zerebubuth/openstreetmap-license-change

With these changes

diff --git a/redact_changeset.rb b/redact_changeset.rb
old mode 100644
new mode 100755
index 988bced..6009e15
--- a/redact_changeset.rb
+++ b/redact_changeset.rb
@@ -13,7 +13,7 @@ require 'yaml'
 require 'optparse'
 require 'typhoeus'

-MAX_CHANGESET_ELEMENTS = 1000
+MAX_CHANGESET_ELEMENTS = 500

 class Server
   def initialize(file, dry_run)
zerebubuth commented 10 years ago

I think I fixed it in 6006392c so please let me know if something like it happens again. I think that the root cause of it being on that code path was that the element it was looking for had concurrently been deleted, which is something that needs to be handled properly, I guess.