Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile based BuildConfig fails to get logs when log-driver is journald #19125

Closed
akram opened this issue Mar 28, 2018 · 1 comment
Closed

Comments

@akram
Copy link
Contributor

akram commented Mar 28, 2018

[provide a description of the issue]
We have a BuildConfig using an inline Dockerfile definition. When an error occurs during the build, we face the following error

failed to open log file "/var/log/pods/d0137be4-329a-11e8-9ed4-005056ab11ad/docker-build_0.log": open /var/log/pods/d0137be4-329a-11e8-9ed4-005056ab11ad/docker-build_0.log: no such file or directory

This should not occur because of this fix: /pull/16912 but we have the issue in openshift 3.7

  1. Create a BuildConfig with the following content , we intentionally try to install a package named jqXYZ to make the build fail.
apiVersion: v1
kind: BuildConfig
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: '{"kind":"BuildConfig","apiVersion":"v1","metadata":{"name":"image-sign-scan-base","namespace":"image-management","selfLink":"/oapi/v1/namespaces/image-management/buildconfigs/image-sign-scan-base","uid":"2c7ff921-3299-11e8-aa55-005056ab20ba","resourceVersion":"49539599","creationTimestamp":"2018-03-28T15:03:29Z"},"spec":{"triggers":[{"type":"ConfigChange"},{"type":"ImageChange","imageChange":{"lastTriggeredImageID":"registry.access.redhat.com/rhel7/rhel@sha256:97669dae14e71a131fdb10dcbc358c0985059b2e84d5167b047626ee7b3e195a"}}],"runPolicy":"Serial","source":{"type":"Dockerfile","dockerfile":"FROM
      registry.access.redhat.com/rhel7/rhel\n\nMAINTAINER Andrew Block \u003cablock@redhat.com\u003e\n\n
      RUN yum repolist \u003e /dev/null \u0026\u0026 \\\n    yum clean all \u0026\u0026
      \\\n    INSTALL_PKGS=\"docker atomic atomic-openshift-clients image-inspector
      tar\" \u0026\u0026 \\\n    yum install -y --enablerepo=rhel-7-server-ose-${OCP_VERSION}-rpms
      --enablerepo=rhel-7-server-extras-rpms --setopt=tsflags=nodocs $INSTALL_PKGS
      \u0026\u0026 \\\n    rpm -V $INSTALL_PKGS \u0026\u0026 \\\n    yum clean all\n"},"strategy":{"type":"Docker","dockerStrategy":{"from":{"kind":"ImageStreamTag","name":"rhel7:7.4"},"env":[{"name":"OCP_VERSION","value":"3.7"}]}},"output":{"to":{"kind":"ImageStreamTag","name":"image-sign-scan-base:latest"}},"resources":{},"postCommit":{},"nodeSelector":null},"status":{"lastVersion":2}}'
  creationTimestamp: null
  name: image-sign-scan-base
spec:
  nodeSelector: null
  output:
    to:
      kind: ImageStreamTag
      name: image-sign-scan-base:latest
  postCommit: {}
  resources: {}
  runPolicy: Serial
  source:
    dockerfile: |
      FROM registry.access.redhat.com/rhel7/rhel
 
      MAINTAINER Andrew Block <ablock@redhat.com>
 
       RUN yum repolist > /dev/null && \
          yum clean all && \
          INSTALL_PKGS="jqXYZ docker atomic atomic-openshift-clients image-inspector tar" && \
          yum install -y --enablerepo=rhel-7-server-ose-${OCP_VERSION}-rpms --enablerepo=rhel-7-server-extras-rpms --setopt=tsflags=nodocs $INSTALL_PKGS && \
          rpm -V $INSTALL_PKGS && \
          yum clean all
    type: Dockerfile
  strategy:
   dockerStrategy:
      env:
      - name: OCP_VERSION
        value: "3.7"
      from:
        kind: ImageStreamTag
        name: rhel7:7.4
    type: Docker
  triggers:
  - type: ConfigChange
  - imageChange: {}
    type: ImageChange
status:
  lastVersion: 0
  1. oc logs -f image-sign-scan-base
Current Result

failed to open log file "/var/log/pods/d0137be4-329a-11e8-9ed4-005056ab11ad/docker-build_0.log": open /var/log/pods/d0137be4-329a-11e8-9ed4-005056ab11ad/docker-build_0.log: no such file or directory

Expected Result

Show the logs for the build

Additional Information

If you go to the docker node running the build and run docker log , we can see the actual logs.

@akram akram changed the title Dockerfile based BuildConfig fails to get logs when log-driver is journal Dockerfile based BuildConfig fails to get logs when log-driver is journald Mar 28, 2018
@akram
Copy link
Contributor Author

akram commented Mar 29, 2018

There were a mismatch between the ose-pod version used and the openshift version.
oups

@akram akram closed this as completed Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant