From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 97B061F461 for ; Fri, 30 Aug 2019 13:41:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id F0AD2120C9A; Fri, 30 Aug 2019 22:41:12 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 6EF20120B02 for ; Fri, 30 Aug 2019 22:41:09 +0900 (JST) Received: by filter0039p3las1.sendgrid.net with SMTP id filter0039p3las1-2435-5D692778-3 2019-08-30 13:41:12.222110521 +0000 UTC m=+321612.213198384 Received: from herokuapp.com (unknown [18.206.95.224]) by ismtpd0036p1iad2.sendgrid.net (SG) with ESMTP id YYy1lUxIRcCL6LtH7EyDIw for ; Fri, 30 Aug 2019 13:41:11.989 +0000 (UTC) Date: Fri, 30 Aug 2019 13:41:12 +0000 (UTC) From: emil@tin.dk Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70236 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 14716 X-Redmine-Issue-Author: snehavas X-Redmine-Sender: emiltin X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?sdalgIF5P2e5S8N8=2Fd4gcCNOfqSk9y7IN=2FjKozx6ANOe7=2FAMstoH0aMVRVPFas?= =?us-ascii?Q?DCZv2NULQdkXfTAsFEAhIzxw85SB6kFPx6FAxwn?= =?us-ascii?Q?6olGOPVcD57YiDeKwnLLgn+O+DQUS0=2FmNeiCHIT?= =?us-ascii?Q?SzcEyq2qzZyvNahgIKSidg2QggZKfyCHL=2FF1afG?= =?us-ascii?Q?hyedbHRIgFfkg?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94684 Subject: [ruby-core:94684] [Ruby master Bug#14716] SecureRandom throwing an error in Ruby 2.5.1 X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #14716 has been updated by emiltin (Emil Tin). I got this when running a ruby script that openened a large number of TCP socket (and thus files). In fact I had to increase the file limit of the shell using ulimit to be able to open enough sockets. ---------------------------------------- Bug #14716: SecureRandom throwing an error in Ruby 2.5.1 https://bugs.ruby-lang.org/issues/14716#change-81290 * Author: snehavas (sneha vasanth) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.6.3 * Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED ---------------------------------------- Hi, We recently upgraded from ruby 2.3.6 to 2.5.1. We use SecureRandom.uuid to generate a random number for our session. Post the upgrade we have been getting the following error intermittently ``` app error: failed to get urandom (RuntimeError) E, [2018-04-27T04:55:08.741859 #16550] ERROR -- : /usr/lib/ruby/2.5.0/securerandom.rb:99:in `urandom' E, [2018-04-27T04:55:08.741898 #16550] ERROR -- : /usr/lib/ruby/2.5.0/securerandom.rb:99:in `gen_random_urandom' E, [2018-04-27T04:55:08.741932 #16550] ERROR -- : /usr/lib/ruby/2.5.0/securerandom.rb:129:in `random_bytes' E, [2018-04-27T04:55:08.741965 #16550] ERROR -- : /usr/lib/ruby/2.5.0/securerandom.rb:219:in `uuid' E, [2018-04-27T04:55:08.741997 #16550] ERROR -- : /usr/share/nginx/frontend/app/utilities/log.rb:74:in `create_session_info' E, [2018-04-27T04:55:08.742036 #16550] ERROR -- : /usr/share/nginx/frontend/app/utilities/log.rb:11:in `context' ``` We understand that there was a change in ruby 2.5.1 where we now look at OS sources as the first point of contact to generate random numbers as opposed to OpenSSL. Any idea why this could be happening? -- https://bugs.ruby-lang.org/