Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined local variable or method `klass' #28

Open
pnorman opened this issue Nov 4, 2013 · 4 comments
Open

undefined local variable or method `klass' #28

pnorman opened this issue Nov 4, 2013 · 4 comments

Comments

@pnorman
Copy link
Contributor

pnorman commented Nov 4, 2013

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
Copy link
Contributor Author

pnorman commented Nov 4, 2013

Note: it seems to of redacted correctly.

@zerebubuth
Copy link
Owner

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

@pnorman
Copy link
Contributor Author

pnorman commented Nov 4, 2013

f2bf2a1:

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 added a commit that referenced this issue Nov 4, 2013
It was referencing out of scope variables. This should fix #28.
@zerebubuth
Copy link
Owner

I think I fixed it in 6006392 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants