Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

Fail sync ArgumentError: invalid %-encoding #159

Closed
miramir opened this issue Sep 25, 2015 · 4 comments
Closed

Fail sync ArgumentError: invalid %-encoding #159

miramir opened this issue Sep 25, 2015 · 4 comments
Assignees
Labels

Comments

@miramir
Copy link

miramir commented Sep 25, 2015

ArgumentError: invalid %-encoding (%D0%9E%D0%B1%D0%BE%D1%81%D0%BE%D0%B1%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5+%D0%BF%D0%BE%D0%B4%D1%80%D0%B0%D0%B7%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5+%D0%B2+%D0%B3.+%D0%9C%D0%B0%D0%B3%D0%BD%D0%B8%D1%82%D0%BE%D0%B3%D0%BE%D1%80%/D1%81%D0%BA)
/usr/lib/ruby/2.1.0/uri/common.rb:901:in `decode_www_form_component'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:143:in `file_path_key'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/ldap_sync/core_ext/file_store.rb:22:in `block in delete_unless'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:168:in `call'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:168:in `block in search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `foreach'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:166:in `block in search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `foreach'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:166:in `block in search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `foreach'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:166:in `block in search_dir'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `foreach'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.4/lib/active_support/cache/file_store.rb:162:in `search_dir'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/ldap_sync/core_ext/file_store.rb:21:in `delete_unless'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/ldap_sync/infectors/auth_source_ldap.rb:333:in `update_closure_cache!'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/ldap_sync/infectors/auth_source_ldap.rb:86:in `sync_users'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/tasks/ldap_sync.rake:29:in `block (5 levels) in <top (required)>'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/relation/delegation.rb:46:in `each'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.4/lib/active_record/relation/delegation.rb:46:in `each'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/tasks/ldap_sync.rake:27:in `block (4 levels) in <top (required)>'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:201:in `block in invoke_prerequisites'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:in `each'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_prerequisites'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/bin/rake:23:in `load'
/home/redmine/redmine/vendor/bundle/ruby/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => redmine:plugins:ldap_sync:sync_all => redmine:plugins:ldap_sync:sync_users
@miramir
Copy link
Author

miramir commented Sep 25, 2015

Environment:
Redmine version 3.1.1.stable
Ruby version 2.1.7-p400 (2015-08-18) [x86_64-linux-gnu]
Rails version 4.2.4
Environment production
Database adapter Mysql2
SCM:
Subversion 1.8.8
Mercurial 2.8.2
Cvs 1.12.13
Bazaar 2.7.0
Git 2.5.3
Filesystem
Redmine plugins:
a_common_libs 1.1.5
extra_queries 2.0.0
global_roles 2.0.0
redmine_bootstrap_kit 0.2-devel
redmine_ckeditor 1.1.2
redmine_custom_workflows 0.1.4
redmine_email_fetcher 0.3.1
redmine_issue_tabs 1.1.0
redmine_issue_templates 0.1.0
redmine_ldap_sync 2.0.7.devel.gba84cac44e
redmine_my_page 0.1.7
redmine_workflow_enhancements 0.4.0
redmine_workflow_hidden_fields 0.2.0
sidebar_hide 0.0.7

@thorin
Copy link
Owner

thorin commented Sep 30, 2015

The error is related with this rails issue: rails/rails#21576

@thorin
Copy link
Owner

thorin commented Sep 30, 2015

Creating the following file file_store.rb under lib/ldap_sync/core_ext should fix it:

# encoding: utf-8
module ActiveSupport::Cache::FileStore
  # Translate a file path into a key.
  def file_path_key(path)
    fname = path[cache_path.to_s.size..-1].split(File::SEPARATOR, 4).last.gsub(File::SEPARATOR, '')
    URI.decode_www_form_component(fname, Encoding::UTF_8)
  end
end

Could you test it?

@thorin thorin added the bug label Sep 30, 2015
@miramir
Copy link
Author

miramir commented Oct 1, 2015

yes, this code fix problem.

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

No branches or pull requests

2 participants