Bug 2026875 - Date parse error around SCA cert fetching when system locale is en_AU or en_CA
Summary: Date parse error around SCA cert fetching when system locale is en_AU or en_CA
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 4.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 4.0
Assignee: Nikos Moumoulidis
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2026873
TreeView+ depends on / blocked
 
Reported: 2021-11-26 10:03 UTC by Nikos Moumoulidis
Modified: 2022-01-18 12:23 UTC (History)
3 users (show)

Fixed In Version: candlepin-4.0.14-1
Clone Of: 2026873
Environment:
Last Closed: 2022-01-18 12:23:35 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 3170 0 None Draft [4.0] Enforce locale when parsing Date from String [ENT-4536] 2021-11-26 10:04:34 UTC

Description Nikos Moumoulidis 2021-11-26 10:03:52 UTC
+++ This bug was initially created as a clone of Bug #2026873 +++

Description of problem:
When the system's default locale is set to en_AU or en_CA (and possibly other locales), SCA cert generation on the /accessible_content candlepin API always fails with 400 status code and this error:

Runtime Error RESTEASY003870: Unable to extract parameter from http request: javax.ws.rs.HeaderParam("If-Modified-Since") value is 'Thu, 01 Jan 1970 00:00:00 GMT' for public javax.ws.rs.core.Response org.candlepin.resource.ConsumerResource.getContentAccessBody(java.lang.String,java.util.Date) at org.candlepin.resteasy.DateFormatter.fromString:75
(see attachment for full stacktrace)

This is only happening on Java 11 (new for Sat 6.10) with root cause being https://bugs.openjdk.java.net/browse/JDK-8208487


Version-Release number of selected component (if applicable):
candlepin-4.0.9-1.el7sat.noarch.rpm

How reproducible:
100%

Steps to Reproduce:
1. Set system locale with "sudo localectl set-locale LANG=en_AU.UTF-8"
2. Restart the tomcat service.
3. Register a host to an organization with SCA mode enabled (the registration and SCA cert generation should still be successful).
4. Check /var/log/candlepin.log on the server, and /var/lib/rhsm/cache/content_access.json on the host.

Actual results:
There is a stack trace and 400 response status on the candlepin.log on the server.
There is no /var/lib/rhsm/cache/content_access.json cache file on the client.

Expected results:
There should be no stack trace or error on the candlepin.log.
The file cache file /var/lib/rhsm/cache/content_access.json should exist on the client.

Additional info:

The effect is minimal, since the SCA cert generation still works (through other API calls subscription-manager/rhsmcertd makes), but the client-side cache loses it's effect, since now the server is re-sending the same SCA certificate on every check in (instead of a 304 response).


Note You need to log in before you can comment on or make changes to this bug.