Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-19819

Pod in crashloop import error with pyodbc

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • 4.11
    • Containers
    • None
    • No
    • False
    • Hide

      None

      Show
      None
    • Hide
      The Customer states that where it is running locally, they are using Python 3.7.4, and pyodbc version 4.0.27.

      In OpenShift, the compiled image running in debug shows us

      (app-root) sh-4.4$ python --version
      Python 3.9.6

      (app-root) sh-4.4$ pip list
      Package Version
      ------------------ ---------
      certifi 2023.7.22
      charset-normalizer 3.2.0
      configparser 6.0.0
      idna 3.4
      pip 21.0.1
      pymssql 2.2.8
      pyodbc 4.0.39
      requests 2.31.0
      schedule 1.2.0
      setuptools 50.3.2
      urllib3 2.0.5
      Show
      The Customer states that where it is running locally, they are using Python 3.7.4, and pyodbc version 4.0.27. In OpenShift, the compiled image running in debug shows us (app-root) sh-4.4$ python --version Python 3.9.6 (app-root) sh-4.4$ pip list Package Version ------------------ --------- certifi 2023.7.22 charset-normalizer 3.2.0 configparser 6.0.0 idna 3.4 pip 21.0.1 pymssql 2.2.8 pyodbc 4.0.39 requests 2.31.0 schedule 1.2.0 setuptools 50.3.2 urllib3 2.0.5

      Description of problem:

      Customer  compiled via S2i, combining their code with a builder image
      Python app stuck in crashloop, it appears to be having problems with pyodbc/odbccon. 
      
      Error:
      Traceback (most recent call last):
      File "/opt/app-root/src/app.py", line 1, in <module>
      import pyodbc as odbccon
      ImportError: libodbc.so.2: cannot open shared object file: No such file or directory
      
      oc logs billing-cycle-update-19-build -c sti-build
      
      2023-09-22T17:45:35.980608639Z Adding cluster TLS certificate authority to trust store
      2023-09-22T17:45:37.609092963Z time="2023-09-22T17:45:37Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
      2023-09-22T17:45:37.621366422Z I0922 17:45:37.621293       1 defaults.go:102] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
      2023-09-22T17:45:37.672184608Z Caching blobs under "/var/cache/blobs".
      2023-09-22T17:45:37.676576336Z Trying to pull image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:210326ea7d1a940d7e8f057cc96a6115c8443658b91a95d6c0ddc91ad80566cd...
      2023-09-22T17:45:37.996166682Z Getting image source signatures
      2023-09-22T17:45:38.170420878Z Copying blob sha256:b46ca46c303b49d886a7585735ebd1dc8651e83d0fab5823300cf3a9fd2febc1
      2023-09-22T17:45:38.202315810Z Copying blob sha256:33c2a11e8c8f149926be1f29dba50a7bb7fcab469d15822c5ff1ba733ef3c74a
      2023-09-22T17:45:38.209404118Z Copying blob sha256:faf2fea3663b6b26a48698856e64b859d6d8cb46bf7d4700e58b7aa941f6fd5f
      2023-09-22T17:45:38.213435736Z Copying blob sha256:8e111a1c7b205e8d46bf83e9725922a10ac4b59f7ce26679318682def91efa55
      2023-09-22T17:45:38.219286707Z Copying blob sha256:ac08ca107ad9ed699cbd28339749dd6463a84c73aa1d468a4241385fc4ec3876
      2023-09-22T17:45:42.403474563Z Copying config sha256:b1c865dba14b09accaa208464e3ded82a533dc20b0fe79fbb8f53063f6aad511
      2023-09-22T17:45:42.418420400Z Writing manifest to image destination
      2023-09-22T17:45:42.421540791Z Storing signatures
      2023-09-22T17:45:51.398464249Z Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:210326ea7d1a940d7e8f057cc96a6115c8443658b91a95d6c0ddc91ad80566cd
      2023-09-22T17:45:51.458629908Z Adding transient rw bind mount for /run/secrets/rhsm
      2023-09-22T17:45:51.460203754Z STEP 1/9: FROM image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:210326ea7d1a940d7e8f057cc96a6115c8443658b91a95d6c0ddc91ad80566cd
      2023-09-22T17:45:51.513872622Z STEP 2/9: LABEL "io.openshift.build.commit.date"="Fri Sep 22 17:39:19 2023 +0000"       "io.openshift.build.commit.id"="fec2b954bcac8d6ed9abb711a8352f16ad0783a3"       "io.openshift.build.commit.ref"="SQLDatabase"       "io.openshift.build.commit.message"="Updated requirements.txt"       "io.openshift.build.source-context-dir"="/"       "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:210326ea7d1a940d7e8f057cc96a6115c8443658b91a95d6c0ddc91ad80566cd"       "io.openshift.build.commit.author"="Rekha Rani Singh <SinghR@corp.cableone.net>"
      2023-09-22T17:45:51.566397558Z STEP 3/9: ENV OPENSHIFT_BUILD_NAME="billing-cycle-update-19"     OPENSHIFT_BUILD_NAMESPACE="xelerate-wrapper"     OPENSHIFT_BUILD_SOURCE="https://CableOne-ProductDevelopers@dev.azure.com/CableOne-ProductDevelopers/XelerateWrapper/_git/Suntec-BillingCycleUpdate"     OPENSHIFT_BUILD_REFERENCE="SQLDatabase"     OPENSHIFT_BUILD_COMMIT="fec2b954bcac8d6ed9abb711a8352f16ad0783a3"
      2023-09-22T17:45:51.617006938Z STEP 4/9: USER root
      2023-09-22T17:45:51.665034442Z STEP 5/9: COPY upload/src /tmp/src
      2023-09-22T17:45:52.030791034Z STEP 6/9: RUN chown -R 1001:0 /tmp/src
      2023-09-22T17:45:52.671278158Z STEP 7/9: USER 1001
      2023-09-22T17:45:52.721068514Z STEP 8/9: RUN /usr/libexec/s2i/assemble
      2023-09-22T17:45:53.244309411Z ---> Installing application source ...
      2023-09-22T17:45:53.314745170Z ---> Installing dependencies ...
      2023-09-22T17:45:53.857002223Z ERROR: Could not find a version that satisfies the requirement unixodbc
      2023-09-22T17:45:53.857002223Z ERROR: No matching distribution found for unixodbc
      2023-09-22T17:45:54.129009675Z WARNING: You are using pip version 21.0.1; however, version 23.2.1 is available.
      2023-09-22T17:45:54.129009675Z You should consider upgrading via the '/opt/app-root/bin/python3.8 -m pip install --upgrade pip' command.
      2023-09-22T17:45:54.411273527Z error: build error: error building at STEP "RUN /usr/libexec/s2i/assemble": error while running runtime: exit status 1 

      Version-Release number of selected component (if applicable

      How reproducible:

       

      Steps to Reproduce:

      1.
      2.
      3.
      

      Actual results:

       

      Expected results:

       

      Additional info:

       

       

              tsweeney@redhat.com Tom Sweeney
              rhn-support-bhab Bharathi B
              David Darrah David Darrah (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: