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

ArgumentError: invalid %-encoding #1

Open
miramir opened this issue Aug 28, 2019 · 8 comments
Open

ArgumentError: invalid %-encoding #1

miramir opened this issue Aug 28, 2019 · 8 comments

Comments

@miramir
Copy link

miramir commented Aug 28, 2019

ArgumentError: invalid %-encoding (%D0%9E%D1%82%D0%B4%D0%B5%D0%BB+%D0%B3%D0%BE%D1%81%D1%83%D0%B4%D0%B0%D1%80%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D1%8B%D1%85+%D0%B8+%D0%BA%D0%BE%D0%BC%D0%BC%D0%B5%D1%80%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D1%85+%D0%B7%D0%B0%D0%BA%D1%83%D/0%BF%D0%BE%D0%BA)
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:144: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/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:169:in block in search_dir' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in foreach'
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in search_dir' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:167:in block in search_dir'
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in foreach' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in search_dir'
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:167:in block in search_dir' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in foreach'
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in search_dir' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:167:in block in search_dir'
/home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163:in foreach' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/cache/file_store.rb:163: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:359:in update_closure_cache!'
/home/redmine/redmine/plugins/redmine_ldap_sync/lib/ldap_sync/infectors/auth_source_ldap.rb:101: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/data/tmp/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71:in each' /home/redmine/data/tmp/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/relation/delegation.rb:71: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.4.0/gems/rake-12.3.2/exe/rake:27:in <top (required)>'
Tasks: TOP => redmine:plugins:ldap_sync:sync_all => redmine:plugins:ldap_sync:sync_users

@miramir
Copy link
Author

miramir commented Aug 28, 2019

Проблема скорее всего связана с тем как отдаёт строку ActiveDirectory.

@miramir
Copy link
Author

miramir commented Aug 28, 2019

скорее всего связано с длинной строки

@miramir
Copy link
Author

miramir commented Aug 28, 2019

Было бы здорово обработать эту ошибку в плагине

@miramir
Copy link
Author

miramir commented Aug 28, 2019

Поразбирался ещё, проблема в файловом кеше, он неправильно обрезает длинные unicode имена. Возможно стоит поискать способ сокращать имена самостоятельно например хешируя sha256

@miramir
Copy link
Author

miramir commented Aug 28, 2019

в оригинальном репозитории уже был этот баг и было решение
thorin#159

miramir added a commit to miramir/redmine_ldap_sync that referenced this issue Aug 28, 2019
Fix name for file name in cache
@tainewoo
Copy link
Owner

Hi miramir,
Thank you for creating this issue.
according to the rails issue: rails/rails#21576
It's fixed by rails v5.2.0.beta1.
And it pass with my environment:
Redmine version 4.0.3.stable
Ruby version 2.6.2-p47 (2019-03-13) [x86_64-linux-gnu]
Rails version 5.2.2.1

Would you like to try to upgrade your rails?
If yes, maybe i will pend this fix because the rails has it's own original fix already.
But if not, i also can create a new hotfix branch and merge it for your environment.

@miramir
Copy link
Author

miramir commented Aug 29, 2019

I use this installation. And can`t upgrade rails. Please apply hot fix.

tainewoo added a commit that referenced this issue Aug 29, 2019
Fix #1 ArgumentError: invalid %-encoding.
---fix ActiveSupport::Cache::FileStore#cleanup does not remove expired entries from cache issue which fails on rails version earlier than v5.2.0.
@tainewoo
Copy link
Owner

Hi @miramir ,
#2
The PR is merged to hotfix,
https://github.com/tainewoo/redmine_ldap_sync/tree/hotfix
You can try it.

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