braini75 / msproject_import

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

when I import the xml file, found that it could not match username #17

Open archonwang opened 7 years ago

archonwang commented 7 years ago

@braini75 when I import the xml file, found that it could not match username. How to fix it? Thanks.

the error logs is

A NoMethodError occurred in msproj_imp#analyze:

  undefined method `[]' for nil:NilClass
  plugins/msproject_import/app/models/msproj_data_file.rb:7:in `save'

-------------------------------
Request:
-------------------------------

* URL : http://192.168.1.41/msproject_import/analyze?project_id=uth_rdc&private_token=false
  * HTTP Method: GET
  * IP address : 192.168.60.238
  * Parameters : {"project_id"=>"uth_rdc", "private_token"=>"false", "controller"=>"msproj_imp", "action"=>"analyze"}
  * Timestamp  : 2017-02-27 03:52:19 UTC
  * Server : jira
  * Rails root : /opt/redmine-3.3
  * Process: 2275

-------------------------------
Session:
-------------------------------

  * session id: "b311a7a6676287872d64c96e41fb4c11"
  * data: {"session_id"=>"b311a7a6676287872d64c96e41fb4c11",
   "user_id"=>8,
   "tk"=>"71335d6f7255e1136456842b77600d4322ec9a99",
   "sudo_timestamp"=>1488157523,
   "_csrf_token"=>"0666i7oqGj3/WF3FBihKEnDK5du334i/5zLctzINJts=",
   "recent_projects"=>[34, 2],
   "access_count_table"=>{30=>1, 77=>1, 78=>1},
   "query"=>
    {:project_id=>34,
     :filters=>{"status_id"=>{:operator=>"o", :values=>[""]}},
     :group_by=>"parent",
     :column_names=>nil,
     :totalable_names=>[:estimated_hours]},
   "issues_index_sort"=>"id:desc",
   "show_locked_contracts"=>true,
   "title"=>"MS Project Import(2017-02-27): 秘语企业版计划表",
   "users_index_sort"=>"login"}

-------------------------------
Environment:
-------------------------------

  * GATEWAY_INTERFACE                              : CGI/1.2
  * HTTP_ACCEPT                                    : */*
  * HTTP_ACCEPT_ENCODING                           : gzip, deflate, sdch
  * HTTP_ACCEPT_LANGUAGE                           : zh-CN,zh;q=0.8,en;q=0.6
  * HTTP_CONNECTION                                : keep-alive
  * HTTP_COOKIE                                    : _redmine_session=Y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WUGp6dGZGakRhNEYwbXY3eFpCNWhuZDlyb0VyNHdEK2NjWUxlRTBnZFNUUU5WM05SeGpVa0pCcGxQU3c9PS0tSHF1d28zekxOalE5OUVCcGVNZGZWQT09--37d3a5850afc195782d8ca64c2ad0f0596451032
  * HTTP_HOST                                      : 192.168.1.41
* HTTP_REFERER : http://192.168.1.41/msproject_import/analyze?project_id=uth_rdc
  * HTTP_USER_AGENT                                : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
  * HTTP_VERSION                                   : HTTP/1.1
  * HTTP_X_REQUESTED_WITH                          : XMLHttpRequest
  * ORIGINAL_FULLPATH                              : /msproject_import/analyze?project_id=uth_rdc&private_token=false
  * ORIGINAL_SCRIPT_NAME                           :
  * PATH_INFO                                      : /msproject_import/analyze
  * QUERY_STRING                                   : project_id=uth_rdc&private_token=false
  * REMOTE_ADDR                                    : 192.168.60.238
  * REQUEST_METHOD                                 : GET
  * REQUEST_PATH                                   : /msproject_import/analyze
  * REQUEST_URI                                    : /msproject_import/analyze?project_id=uth_rdc&private_token=false
  * ROUTES_37158920_SCRIPT_NAME                    :
  * SCRIPT_NAME                                    :
  * SERVER_NAME                                    : 192.168.1.41
  * SERVER_PORT                                    : 80
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : thin 1.7.0 codename Dunder Mifflin
  * action_controller.instance                     : #<MsprojImpController:0x007f11d86d3170>
  * action_dispatch.backtrace_cleaner              : #<Rails::BacktraceCleaner:0x0000000475b418>
  * action_dispatch.cookies                        : #<ActionDispatch::Cookies::CookieJar:0x007f11d93c3498>
  * action_dispatch.cookies_digest                 :
  * action_dispatch.cookies_serializer             :
  * action_dispatch.encrypted_cookie_salt          : encrypted cookie
  * action_dispatch.encrypted_signed_cookie_salt   : signed encrypted cookie
  * action_dispatch.http_auth_salt                 : http authentication
  * action_dispatch.key_generator                  : #<ActiveSupport::CachingKeyGenerator:0x0000000b1c1de8>
  * action_dispatch.logger                         : #<ActiveSupport::Logger:0x000000047771b8>
  * action_dispatch.parameter_filter               : [:password]
  * action_dispatch.redirect_filter                : []
  * action_dispatch.remote_ip                      : 192.168.60.238
  * action_dispatch.request.accepts                : [#<Mime::Type:0x007f11d86d1028 @synonyms=[], @symbol=nil, @string="*/*", @hash=-672889128333174637>]
  * action_dispatch.request.content_type           :
  * action_dispatch.request.flash_hash             : #<ActionDispatch::Flash::FlashHash:0x007f11f409f670>
  * action_dispatch.request.formats                : [#<Mime::Type:0x007f11d86d1028 @synonyms=[], @symbol=nil, @string="*/*", @hash=-672889128333174637>]
  * action_dispatch.request.parameters             : {"project_id"=>"uth_rdc", "private_token"=>"false", "controller"=>"msproj_imp", "action"=>"analyze"}
  * action_dispatch.request.path_parameters        : {:controller=>"msproj_imp", :action=>"analyze"}
  * action_dispatch.request.query_parameters       : {"project_id"=>"uth_rdc", "private_token"=>"false"}
  * action_dispatch.request.request_parameters     : {}
  * action_dispatch.request.unsigned_session_cookie: {"session_id"=>"b311a7a6676287872d64c96e41fb4c11", "user_id"=>8, "tk"=>"71335d6f7255e1136456842b77600d4322ec9a99", "sudo_timestamp"=>1488157523, "_csrf_token"=>"0666i7oqGj3/WF3FBihKEnDK5du334i/5zLctzINJts=", "recent_projects"=>[34, 2], "access_count_table"=>{30=>1, 77=>1, 78=>1}, "query"=>{:project_id=>34, :filters=>{"status_id"=>{:operator=>"o", :values=>[""]}}, :group_by=>"parent", :column_names=>nil, :totalable_names=>[:estimated_hours]}, "issues_index_sort"=>"id:desc", "show_locked_contracts"=>true, "title"=>"MS Project Import(2017-02-27): 秘语企业版计划表", "users_index_sort"=>"login"}
  * action_dispatch.request_id                     : 0acbe5a0-86cc-4401-b1c7-1681e4736426
  * action_dispatch.routes                         : #<ActionDispatch::Routing::RouteSet:0x000000046e0010>
  * action_dispatch.secret_key_base                : 59dda17a42803617f96151518b9aeecb94e132c6f140123f1982e1c8ae15d0103ffa854c4d8b0019
  * action_dispatch.secret_token                   :
  * action_dispatch.show_detailed_exceptions       : false
  * action_dispatch.show_exceptions                : true
  * action_dispatch.signed_cookie_salt             : signed cookie
  * async.callback                                 : #<Method: Thin::Connection#post_process>
  * async.close                                    : #<EventMachine::DefaultDeferrable:0x007f11c4942050>
  * rack.errors                                    : #<IO:0x00000001001580>
  * rack.input                                     : #<StringIO:0x007f11c4943040>
  * rack.multiprocess                              : false
  * rack.multithread                               : true
  * rack.request.cookie_hash                       : {"_redmine_session"=>"YzM5dGFzT0IrU1AybmUwcFR6TjhhcEhWaldnWmpnV0lVVHFDUFFhbFdnVmtDYkVhM0s0SkFtSGM5akc3aUF6aUFPbXU0QVJISW5LWjZWYTBNbG9ISzJHa3psdzlNVXFLQ2NWUTAxaDZVOGVUSUw2M1VlL2U2WUlBZW9XcFlFTDM2OVNjTDcwbW1nSWR2eVFNa1AwenNRamw3SUVuWUxRRjVPTC9BeStlOVZrRDBzcEw2TE56L0pYK3BzMkRmeHM0ZkxSUUtHNlJaRkNyUmJ5ZExHL2ZiUm1OVTB4NWx3T2g4a0tqM2tDY05SVWhBYXREanVqaDlVTmJOZ0V6K3Z4ME5FbGFDQkVUeVZCT3d6Qit6c3RQZ2hzMCtWQTRQUDJRZEgvclM1VW51ODJ2ZnNVNyt4R3lycDR0KzVHK0tSREtieWQ3SjVRMFEzWEpUeWVxV0FMODVXRTlWVDFPNXFoQURxRU1mM0NkdFlXT0pyNURKTUp5VUFMUG9kZVEzYnphOVNNUHBuZHJ1RkQ3a0RpTTJjcXhBTkdSUU9ac0g0QVh3N0ErL3ZUUE5wRlV4b0svTHB3SDNlMjRDNEVDWU9Dek1paUNPWkZPTk4yMU9zT2R5YkNhYXZEWWZpdFNMYlZteUdmRjAzTmhhWTArRER5SVFLMFRSNk1jUEdrS1R2K2kwaGpTVHRNRENhN2VjblJVZ3pUZnhsVnF1d0RhUnpGNXluRlZVSnZCSkI0aTJxM3hYS1pHbnE2OTVCei9kWSt6MExjaStHY1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PTk4yMU9zT2R5YkNhYXZEWWZpdFNMYlZteUdmRjAzTmhhWTArRER5SVFLMFRSNk1jUEdrS1R2K2kwaGpTVHRNRENhN2VjblJVZ3pUZnhsVnF1d0RhUnpGNXluRlZVSnZCSkI0aTJxM3hYS1pHbnE2OTVCei9kWSt6MExjaStHY1B4TFF4YUJoancxelkwNWJnbGdhMHhuRkFGK1Y0RkhQb3E3Zi9KekwwME9YaFRGclpYY1Z6cmhKTzJ3cFJRczIwYXJEajduMFdqNU94YldKZ0NGY1VnYVYySEtnYWJaSitwd3VQYkZXSkZJZTFEZFA2alY1NktMWituYlZHRnBFRDY5azN5RmRWM2hTaXEvcG0zRzFFd0dhQ21acEQ1OVpNcTN4a2Z6NWFjcC91OVBva3c2WVlrTjFiU3RKUmpXV2ZoeTJLYldtV21vY2pjclRPMnhWUGp6dGZGakRhNEYwbXY3eFpCNWhuZDlyb0VyNHdEK2NjWUxlRTBnZFNUUU5WM05SeGpVa0pCcGxQU3c9PS0tSHF1d28zekxOalE5OUVCcGVNZGZWQT09--37d3a5850afc195782d8ca64c2ad0f0596451032
  * rack.request.query_hash                        : {"project_id"=>"uth_rdc", "private_token"=>"false"}
  * rack.request.query_string                      : project_id=uth_rdc&private_token=false
  * rack.run_once                                  : false
  * rack.session                                   : #<ActionDispatch::Request::Session:0x007f11d889a7d8>
  * rack.session.options                           : #<ActionDispatch::Request::Session::Options:0x007f11d889a788>
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 0]

-------------------------------
Backtrace:
-------------------------------

  plugins/msproject_import/app/models/msproj_data_file.rb:7:in `save'
  plugins/msproject_import/app/controllers/msproj_imp_controller.rb:33:in `analyze'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
archonwang commented 7 years ago

log file error

Started GET "/msproject_import/analyze?project_id=uth_rdc&private_token=false" for 192.168.60.238 at 2017-02-27 11:53:15 +0800
Processing by MsprojImpController#analyze as */*
  Parameters: {"project_id"=>"uth_rdc", "private_token"=>"false"}
  Current user: hui.wang (id=8)
Completed 500 Internal Server Error in 11ms (ActiveRecord: 2.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_request.text.erb (0.8ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_session.text.erb (1.9ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_environment.text.erb (2.6ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_backtrace.text.erb (0.5ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/_title.text.erb (0.4ms)
  Rendered /usr/local/rvm/gems/ruby-2.2.4@newgemset/gems/exception_notification-4.2.1/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb (17.7ms)

NoMethodError (undefined method `[]' for nil:NilClass):
  plugins/msproject_import/app/models/msproj_data_file.rb:7:in `save'
  plugins/msproject_import/app/controllers/msproj_imp_controller.rb:33:in `analyze'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'