question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move certifi to an optional dependency

See original GitHub issue

Describe the bug: …

https://github.com/elastic/apm-agent-python lists the license as BSD-3-Clause. However https://pypi.org/project/liccheck/ reports that it pulls in certifi which has an MPL license:

1 package.
    certifi (2020.6.20): ['Mozilla Public License 2.0 (MPL 2.0)', 'MPL-2.0']
      dependency:
          certifi << elastic-apm

My understanding of the MPL is that it is a copy-left license, which means it should have to appear in the larger work’s license notification. If that’s the case, that’s also problematic for us since the agent has to be built into the source code, and we can’t have copy left licenses like GPL/LGPL in there.

To Reproduce

  1. create a requirements.txt file with nothing but elastic-apm[flask] in it
  2. create an authorized-licenses.ini file that allows MIT and BSD licenses:
[Licenses]
authorized_licenses:
  mit
  bsd

unauthorized_licenses:

[Authorized Packages]

  1. create a simple Dockerfile:
FROM amazonlinux:2018.03

RUN yum update -y && \
    yum install -y python27 python27-devel.x86_64 && \
    yum install -y wget && \
    wget https://bootstrap.pypa.io/get-pip.py && \
    python27 get-pip.py && \
    pip install liccheck && \
    pip install elastic-apm[flask]

COPY ./ ./

RUN liccheck -s authorized-licenses.ini -r requirements.txt -l Paranoid
  1. Run Docker build:
docker build .

Result:

gathering licenses...
5 packages and dependencies.
check authorized packages...
4 packages.
check unknown packages...
1 package.
    certifi (2020.6.20): ['Mozilla Public License 2.0 (MPL 2.0)', 'MPL-2.0']
      dependency:
          certifi << elastic-apm
The command '/bin/sh -c liccheck -s authorized-licenses.ini -r requirements.txt -l Paranoid' returned a non-zero code: 255

Environment (please complete the following information)

  • OS: Linux
  • Python version: 2.7
  • Framework and version [e.g. Django 2.1]: Flask
  • APM Server version:
  • Agent version:

Additional context

  • requirements.txt:

    Click to expand
    elastic-apm[flask]
    

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
beniwohlicommented, Jan 20, 2021

@gatos-cc our plan changed a bit, since we’ve since noticed that especially in Docker images based on Debian, the default certificate bundle is often not available.

So, instead of removing certifi altogether, we’ll make the import conditional, and set ca_certs to None (here) if the import fails. While pip install elastic-apm will still download certifi, you’ll be able to call pip uninstall certifi right after, and then the agent will fall back to the OS-bundled certificate store.

0reactions
basepicommented, Apr 6, 2022

Yeah, if I could include it on pip install elastic-apm but remove it for pip install elastic-apm[flast-no-certifi] I would do that in a heartbeat. If you can find anything in setuptools to that effect I’d be happy to implement it.

Sorry for the inconvenience!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems using Maven and SSL behind proxy
The answer above is a good working solution, but here's how to do it if you want to use the SSL repo: Use...
Read more >
About the move process in Azure Resource Mover
Resource Mover analyzes resource dependencies, and maintains and manages the state of resources during the move process.
Read more >
Dependency Management With Python Poetry
A dependency manager like Python Poetry helps you specify, install, and resolve ... Create the project, and then move into the newly created...
Read more >
Update security certificates with a different CA
Updating node security certificates ... Dependencies and versions ... (Optional) Use the SSL certificate API to verify that Elasticsearch loaded the new ...
Read more >
Announcing Poetry 1.2.0 | Blog
Installing group dependencies #. By default, dependencies across all non-optional groups will be installed when executing poetry install . You ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found