Bug 2063717
Summary: | puma sometimes throws Errno::ENOENT: No such file or directory @ rb_sysopen - /usr/share/foreman/tmp/cache/0E3/781/.permissions_check.220838320.2072127.637105 | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Jan Jansky <jjansky> |
Component: | Infrastructure | Assignee: | Eric Helms <ehelms> |
Status: | CLOSED ERRATA | QA Contact: | Radek Mynar <rmynar> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.9.6 | CC: | ahumbe, apatel, arunas.z.vaznevicius, bbuckingham, bkearney, ehelms, fperalta, hyu, jhutar, jpasqual, jpathan, jsenkyri, lstejska, mhulan, pmendezh, rlavi, rmynar, satellite6-bugs, saydas |
Target Milestone: | 6.15.0 | Keywords: | Performance, Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2024-04-23 17:11:03 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jan Jansky
2022-03-14 08:45:40 UTC
See if this KCS helps https://access.redhat.com/solutions/3782821 Yes, I can try to a look it This issue can happen if we use the same non-admin user to make API calls concurrently and continuously for more than 2 minutes because the cache life is 2 minutes. The race condition occurs when 1 or more API request trying to read the deleted cache and raise error. How to reproduce the issue: 1. Open a terminal (Either in satellite or in other host) and then make multiple concurrent requests to query the smart proxies. ~~~ irb require 'rest_client' 250.times {10.times { Thread.new { begin; RestClient::Resource.new("https://satellite.example.com/api/smart_proxies", user: "username", password: "pass", timeout: 3600, open_timeout: 3600, verify_ssl: OpenSSL::SSL::VERIFY_NONE).get; rescue StandardError => e; p e.message; end }}; sleep 2} ~~~ 2. In Satellite run, tail the production.log. ~~~ tail -f /var/log/foreman/production.log | grep -i "No such file" ~~~ 3. After some time you should start seeing the errors like below: ~~~ 2023-04-26T18:02:31 [I|app|42c1284e] Backtrace for 'Action failed' error (Errno::ENOENT): No such file or directory @ rb_sysopen - /usr/share/foreman/tmp/cache/10D/6F1/.permissions_check.234040.2314370.945374 2023-04-26T18:02:31 [I|app|10a508c4] Backtrace for 'Action failed' error (Errno::ENOENT): No such file or directory @ rb_sysopen - /usr/share/foreman/tmp/cache/10D/6F1/.permissions_check.234060.2314364.423521 2023-04-26T18:02:31 [I|app|a51a7938] Backtrace for 'Action failed' error (Errno::ENOENT): No such file or directory @ rb_sysopen - /usr/share/foreman/tmp/cache/10D/6F1/.permissions_check.233940.2314370.586758 ~~~ Additional info: To make the error easier to reproduce, you can reduce the "delay" to something like "10.seconds". /usr/share/foreman/app/models/user.rb ~~~ def taxonomy_and_child_ids(taxonomies) delay = Rails.env.test? ? 0 : 2.minutes <====================== Rails.cache.fetch("user/#{id}/taxonomy_and_child_ids/#{taxonomies}", expires_in: delay) do top_level = send(taxonomies) + taxonomies.to_s.classify.constantize.unscoped.select { |tax| tax.ignore?('user') } top_level.each_with_object([]) do |taxonomy, ids| ids.concat taxonomy.subtree_ids end.uniq end end ~~~ *** Bug 2122461 has been marked as a duplicate of this bug. *** We believe that at a certain scale, the file cache cannot handle the traffic. To alleviate this, we need to introduce a Redis based caching option for users to enable. Redis is already a part of the deployment architecture used by both Dynflow and Pulp for content caching. Bulk setting Target Milestone = 6.15.0 where sat-6.15.0+ is set. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Satellite 6.15.0 release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2024:2010 |