From 01b9d8e0e6ec9f4fe8e698c25963fe59d09b2738 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 16:54:12 -0500 Subject: [PATCH 01/11] Take over logging and reroute everything to log4j --- gradle/verification-metadata.xml | 5 +++++ modules/ingest-attachment/build.gradle | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index b2683949fb799..ed5cecf5d8adf 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -3449,6 +3449,11 @@ + + + + + diff --git a/modules/ingest-attachment/build.gradle b/modules/ingest-attachment/build.gradle index 36dfd027cd814..3d5a2cb3eba26 100644 --- a/modules/ingest-attachment/build.gradle +++ b/modules/ingest-attachment/build.gradle @@ -23,6 +23,11 @@ versions << [ ] dependencies { + // take over logging for all dependencies, route slf4j and jcl over log4j + api "org.slf4j:slf4j-api:${versions.slf4j}" + api "org.slf4j:jcl-over-slf4j:${versions.slf4j}" + api "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" + // mandatory for tika api "org.apache.tika:tika-core:${versions.tika}" api "org.apache.tika:tika-langdetect:${versions.tika}" @@ -38,7 +43,6 @@ dependencies { api "org.apache.tika:tika-parser-zip-commons:${versions.tika}" api 'org.tukaani:xz:1.8' api 'commons-io:commons-io:2.11.0' - api "org.slf4j:slf4j-api:${versions.slf4j}" // character set detection api 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3' @@ -50,7 +54,6 @@ dependencies { api "org.apache.pdfbox:pdfbox:${versions.pdfbox}" api "org.apache.pdfbox:fontbox:${versions.pdfbox}" api "org.apache.pdfbox:jempbox:1.8.17" - api "commons-logging:commons-logging:${versions.commonslogging}" // OpenOffice api "org.apache.poi:poi-ooxml:${versions.poi}" api "org.apache.poi:poi-ooxml-lite:${versions.poi}" From 80d9e801cbc251cd00cb1943ebe676d034c41dac Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 16:55:11 -0500 Subject: [PATCH 02/11] Add an additional permission for log4j within Tika --- .../main/java/org/elasticsearch/ingest/attachment/TikaImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java b/modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java index 62196acc65a95..5e42edbedfaac 100644 --- a/modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java +++ b/modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java @@ -149,6 +149,8 @@ static PermissionCollection getRestrictedPermissions() { } catch (IOException e) { throw new UncheckedIOException(e); } + // log4j needs to be able to check the environment + perms.add(new RuntimePermission("getenv.*")); // current hacks needed for POI/PDFbox issues: perms.add(new SecurityPermission("putProviderProperty.BC")); perms.add(new SecurityPermission("insertProvider")); From 72106c0e945a80576457b6c6351a7711eb268504 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 16:55:47 -0500 Subject: [PATCH 03/11] Quiet down some internal logging during extraction by default. This can, of course, be turned back up as usual via the logging layer and/or cluster settings. --- modules/ingest-attachment/build.gradle | 4 ++++ modules/ingest-attachment/src/main/config/log4j2.properties | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 modules/ingest-attachment/src/main/config/log4j2.properties diff --git a/modules/ingest-attachment/build.gradle b/modules/ingest-attachment/build.gradle index 3d5a2cb3eba26..0b38bfa01a77b 100644 --- a/modules/ingest-attachment/build.gradle +++ b/modules/ingest-attachment/build.gradle @@ -87,6 +87,10 @@ tasks.named("dependencyLicenses").configure { mapping from: /tika-langdetect-.*/, to: 'tika-langdetect' } +esplugin.bundleSpec.from('config/ingest-attachment') { + into 'config' +} + tasks.named("forbiddenPatterns").configure { exclude '**/*.doc' exclude '**/*.docx' diff --git a/modules/ingest-attachment/src/main/config/log4j2.properties b/modules/ingest-attachment/src/main/config/log4j2.properties new file mode 100644 index 0000000000000..149452b2bb3b1 --- /dev/null +++ b/modules/ingest-attachment/src/main/config/log4j2.properties @@ -0,0 +1,5 @@ +logger.com_apache_pdfbox_font.name = org.apache.pdfbox.pdmodel.font +logger.com_apache_pdfbox_font.level = error + +logger.com_apache_poi.name = org.apache.poi +logger.com_apache_poi.level = error From ba9a330bccf3956cc578df9c81c84c6fb49d4c22 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 17:05:45 -0500 Subject: [PATCH 04/11] Update docs/changelog/93608.yaml --- docs/changelog/93608.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/changelog/93608.yaml diff --git a/docs/changelog/93608.yaml b/docs/changelog/93608.yaml new file mode 100644 index 0000000000000..c49de34008276 --- /dev/null +++ b/docs/changelog/93608.yaml @@ -0,0 +1,6 @@ +pr: 93608 +summary: Ingest-attachment error/stacktrace logging fix +area: Ingest Node +type: bug +issues: + - 91964 From 3b4fec344a79a70fc21b0de0fa5beaeea3ac85fc Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 17:19:16 -0500 Subject: [PATCH 05/11] Drop commons-logging LICENSE and NOTICE Since we're not using that library anymore. --- .../licenses/commons-logging-LICENSE.txt | 202 ------------------ .../licenses/commons-logging-NOTICE.txt | 5 - 2 files changed, 207 deletions(-) delete mode 100644 modules/ingest-attachment/licenses/commons-logging-LICENSE.txt delete mode 100644 modules/ingest-attachment/licenses/commons-logging-NOTICE.txt diff --git a/modules/ingest-attachment/licenses/commons-logging-LICENSE.txt b/modules/ingest-attachment/licenses/commons-logging-LICENSE.txt deleted file mode 100644 index d645695673349..0000000000000 --- a/modules/ingest-attachment/licenses/commons-logging-LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/ingest-attachment/licenses/commons-logging-NOTICE.txt b/modules/ingest-attachment/licenses/commons-logging-NOTICE.txt deleted file mode 100644 index 72eb32a902458..0000000000000 --- a/modules/ingest-attachment/licenses/commons-logging-NOTICE.txt +++ /dev/null @@ -1,5 +0,0 @@ -Apache Commons CLI -Copyright 2001-2009 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). From c84e438a9181000e9df8cd34b9c9724bf6c4e87d Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 17:24:04 -0500 Subject: [PATCH 06/11] Add log4j-slf4j-impl LICENSE and NOTICE https://github.com/apache/logging-log4j2/tree/release-2.x/log4j-slf4j-impl for the actual implementation, and https://github.com/apache/logging-log4j2/tree/release-2.x for the LICENSE.txt and NOTICE.txt contents. --- .../licenses/log4j-slf4j-impl-LICENSE.txt | 202 ++++++++++++++++++ .../licenses/log4j-slf4j-impl-NOTICE.txt | 20 ++ 2 files changed, 222 insertions(+) create mode 100644 modules/ingest-attachment/licenses/log4j-slf4j-impl-LICENSE.txt create mode 100644 modules/ingest-attachment/licenses/log4j-slf4j-impl-NOTICE.txt diff --git a/modules/ingest-attachment/licenses/log4j-slf4j-impl-LICENSE.txt b/modules/ingest-attachment/licenses/log4j-slf4j-impl-LICENSE.txt new file mode 100644 index 0000000000000..6279e5206de13 --- /dev/null +++ b/modules/ingest-attachment/licenses/log4j-slf4j-impl-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 1999-2005 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/modules/ingest-attachment/licenses/log4j-slf4j-impl-NOTICE.txt b/modules/ingest-attachment/licenses/log4j-slf4j-impl-NOTICE.txt new file mode 100644 index 0000000000000..bbb5fb3f66e2a --- /dev/null +++ b/modules/ingest-attachment/licenses/log4j-slf4j-impl-NOTICE.txt @@ -0,0 +1,20 @@ +Apache Log4j +Copyright 1999-2023 Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). + +ResolverUtil.java +Copyright 2005-2006 Tim Fennell + +Dumbster SMTP test server +Copyright 2004 Jason Paul Kitchen + +TypeUtil.java +Copyright 2002-2012 Ramnivas Laddad, Juergen Hoeller, Chris Beams + +picocli (http://picocli.info) +Copyright 2017 Remko Popma + +TimeoutBlockingWaitStrategy.java and parts of Util.java +Copyright 2011 LMAX Ltd. From 3ff7f00946df25ce1c974b717fe5eeab431efd04 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Wed, 8 Feb 2023 17:25:57 -0500 Subject: [PATCH 07/11] Add jcl-over-slf4j LICENSE and NOTICE https://github.com/qos-ch/slf4j/tree/master/jcl-over-slf4j is where the implementation lives, there's a LICENSE there but no notice, nor do I see a notice in the directory above that. --- .../licenses/jcl-over-slf4j-LICENSE.txt | 176 ++++++++++++++++++ .../licenses/jcl-over-slf4j-NOTICE.txt | 0 2 files changed, 176 insertions(+) create mode 100644 modules/ingest-attachment/licenses/jcl-over-slf4j-LICENSE.txt create mode 100644 modules/ingest-attachment/licenses/jcl-over-slf4j-NOTICE.txt diff --git a/modules/ingest-attachment/licenses/jcl-over-slf4j-LICENSE.txt b/modules/ingest-attachment/licenses/jcl-over-slf4j-LICENSE.txt new file mode 100644 index 0000000000000..2bb9ad240fa04 --- /dev/null +++ b/modules/ingest-attachment/licenses/jcl-over-slf4j-LICENSE.txt @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/modules/ingest-attachment/licenses/jcl-over-slf4j-NOTICE.txt b/modules/ingest-attachment/licenses/jcl-over-slf4j-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d From 30e8548a3039e5438e6db4ee2aee9b0b946f7915 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Thu, 9 Feb 2023 11:34:27 -0500 Subject: [PATCH 08/11] Exclude commons-logging from testing classpath, too Otherwise the LLRC brings it in and we end up in jar-hell. --- modules/ingest-attachment/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ingest-attachment/build.gradle b/modules/ingest-attachment/build.gradle index 0b38bfa01a77b..e51296e92116a 100644 --- a/modules/ingest-attachment/build.gradle +++ b/modules/ingest-attachment/build.gradle @@ -22,6 +22,9 @@ versions << [ 'mime4j': '0.8.5' ] +// exclude commons-logging from all dependencies to avoid jar-hell, we use jcl-over-slf4j here +configurations.all { exclude module: 'commons-logging' } + dependencies { // take over logging for all dependencies, route slf4j and jcl over log4j api "org.slf4j:slf4j-api:${versions.slf4j}" From f8b40badfc7e9dad296f9db9625cbbb10e288d93 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Thu, 9 Feb 2023 13:32:27 -0500 Subject: [PATCH 09/11] Another attempt at making gradle happy smash-my-computer.gif --- modules/ingest-attachment/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ingest-attachment/build.gradle b/modules/ingest-attachment/build.gradle index e51296e92116a..24cb901ae1c51 100644 --- a/modules/ingest-attachment/build.gradle +++ b/modules/ingest-attachment/build.gradle @@ -22,8 +22,8 @@ versions << [ 'mime4j': '0.8.5' ] -// exclude commons-logging from all dependencies to avoid jar-hell, we use jcl-over-slf4j here -configurations.all { exclude module: 'commons-logging' } +// exclude commons-logging from test dependencies to avoid jar-hell, we use jcl-over-slf4j here +configurations.testRuntimeClasspath { exclude module: 'commons-logging' } dependencies { // take over logging for all dependencies, route slf4j and jcl over log4j From b3c1fddbadf11ec9e247a28019ba1a0280399715 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 13 Feb 2023 17:44:45 -0500 Subject: [PATCH 10/11] Bump slf4j to 2.0.6 for registration bugfix Without this, slf4j says that "SLF4J: No SLF4J providers were found." --- gradle/verification-metadata.xml | 12 ++++++------ modules/ingest-attachment/build.gradle | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index fcd1d22e06a22..7b3885867661e 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -3464,9 +3464,9 @@ - - - + + + @@ -3504,9 +3504,9 @@ - - - + + + diff --git a/modules/ingest-attachment/build.gradle b/modules/ingest-attachment/build.gradle index 9c4be45cf67e7..3369d24b08951 100644 --- a/modules/ingest-attachment/build.gradle +++ b/modules/ingest-attachment/build.gradle @@ -29,8 +29,8 @@ configurations.testRuntimeClasspath { exclude module: 'commons-logging' } dependencies { // take over logging for all dependencies, route slf4j and jcl over log4j - api "org.slf4j:slf4j-api:2.0.3" - api "org.slf4j:jcl-over-slf4j:2.0.3" + api "org.slf4j:slf4j-api:2.0.6" + api "org.slf4j:jcl-over-slf4j:2.0.6" api "org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0" // mandatory for tika From ee0e3be036f86f378f1cf4be353e49af755401c5 Mon Sep 17 00:00:00 2001 From: Joe Gallo Date: Mon, 13 Feb 2023 17:51:08 -0500 Subject: [PATCH 11/11] Delete docs/changelog/93608.yaml --- docs/changelog/93608.yaml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 docs/changelog/93608.yaml diff --git a/docs/changelog/93608.yaml b/docs/changelog/93608.yaml deleted file mode 100644 index c49de34008276..0000000000000 --- a/docs/changelog/93608.yaml +++ /dev/null @@ -1,6 +0,0 @@ -pr: 93608 -summary: Ingest-attachment error/stacktrace logging fix -area: Ingest Node -type: bug -issues: - - 91964