braini75 / msproject_import

Redmine-Plugin: XML-Task-Importer for MS Project
9 stars 11 forks source link

Import Error: NoMethodError (undefined method `text' for nil:NilClass) #7

Closed antibios closed 8 years ago

antibios commented 8 years ago

Hey, I'm trying to import an XML file that I believe is in the correct format (Please see the attachment). I get the following error:

Started POST "/msproject_import/analyze?project_id=prg-merge" for 127.11.172.129 at 2016-02-10 20:39:51 -0500
Processing by MsprojImpController#analyze as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"jVrh7KhTrcWLsnANnM8ckurRM6M82bXiEQkZgUQ4W8Q=", "uploaded_file"=>#<Ac
tionDispatch::Http::UploadedFile:0x0000000657a610 @original_filename="MattTEstProject.xml", @content_type="text/xml", @
headers="Content-Disposition: form-data; name=\"uploaded_file\"; filename=\"MattTEstProject.xml\"\r\nContent-Type: text
/xml\r\n", @tempfile=#<File:/tmp/RackMultipart20160210-235214-1l25you>>, "commit"=>"Analyze", "project_id"=>"prg-merge"
}
  Current user: admin (id=1)
upload xml file: ActionDispatch::Http::UploadedFile: #<ActionDispatch::Http::UploadedFile:0x0000000657a610 @original_fi
lename="MattTEstProject.xml", @content_type="text/xml", @headers="Content-Disposition: form-data; name=\"uploaded_file\
"; filename=\"MattTEstProject.xml\"\r\nContent-Type: text/xml\r\n", @tempfile=#<File:/tmp/RackMultipart20160210-235214-
1l25you>> : MattTEstProject.xml : uploaded_path: /tmp/RackMultipart20160210-235214-1l25you
Completed 500 Internal Server Error in 61.9ms

NoMethodError (undefined method `text' for nil:NilClass):
  plugins/msproject_import/app/helpers/msproj_imp_helper.rb:55:in `xml_tasks'
  plugins/msproject_import/app/controllers/msproj_imp_controller.rb:114:in `block (2 levels) in analyze'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/element.rb:905:in `block in each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/xpath.rb:67:in `each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/xpath.rb:67:in `each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/element.rb:905:in `each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/element.rb:393:in `each_element'
  plugins/msproject_import/app/controllers/msproj_imp_controller.rb:113:in `block in analyze'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/element.rb:905:in `block in each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/xpath.rb:67:in `each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/xpath.rb:67:in `each'
  /opt/rh/ruby193/root/usr/share/ruby/rexml/element.rb:905:in `each'
  plugins/msproject_import/app/controllers/msproj_imp_controller.rb:57:in `analyze'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/abstract_controller/base.rb:167:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/rendering.rb:10:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:480:in `_run__2287706328425925387__process_action__113634944854011905__callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:405:in `__run_callback'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/callbacks.rb:81:in `run_callbacks'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/abstract_controller/callbacks.rb:17:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/rescue.rb:29:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/notifications.rb:123:in `block in instrument'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.16/lib/active_support/notifications.rb:123:in `instrument'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/abstract_controller/base.rb:121:in `process'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/abstract_controller/rendering.rb:45:in `process'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal.rb:203:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_controller/metal.rb:246:in `block in action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:73:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:36:in `call'
  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
  vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/routing/route_set.rb:608:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-openid-1.4.2/lib/rack/openid.rb:98:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/head.rb:14:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/flash.rb:242:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
  vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/cookies.rb:341:in `call'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/query_cache.rb:64:in `call'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.16/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'

MattTEstProject.xml.zip

antibios commented 8 years ago

Versions: ruby 1.9.1

msproject_import is upto date.

~/Documents/pm/plugins$ git clone http://github.com/braini75/msproject_import.git
Cloning into 'msproject_import'...
remote: Counting objects: 128, done.
remote: Total 128 (delta 0), reused 0 (delta 0), pack-reused 128
Receiving objects: 100% (128/128), 18.65 KiB | 0 bytes/s, done.
Resolving deltas: 100% (48/48), done.
Checking connectivity... done.
braini75 commented 8 years ago

Hallo antibios,

thank you for your Report. This was really helpful!

Please checkout my new Version 0.3.0 - It should work!

antibios commented 8 years ago

Works beautifully!

FYI the numbering of my Status and Priority in the DB was off. So I ended up just hard coding the values that I was after.

Thank you for getting an update so quickly

Matt