Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

no source code in container after odo link (odo push is not helping) #4768

@kadel

Description

@kadel
▶ odo version
odo v2.2.1 (f9449083e)

Server: https://api.crc.testing:6443
Kubernetes: v1.20.0+7d0a2b2
  • Installed operators:
    • "PostgreSQL Operator by Dev4Ddevs.com" 0.1.1
    • "Service Binding" 0.7.1
▶ git clone https://github.com/spring-projects/spring-petclinic

▶ odo create java-maven

▶ odo config set Memory 1Gi

▶ cat db.yaml 
apiVersion: postgresql.dev4devs.com/v1alpha1
kind: Database
metadata:
  name: postgresql
annotations:
  "service.binding/database": "path={.spec.databaseName}"
  "service.binding/username": "path={.spec.databaseUser}"
  "service.binding/password": "path={.spec.databasePassword}"
spec:
  databaseName: example
  databasePassword: postgres
  databaseStorageRequest: 1Gi
  databaseUser: postgres
  image: centos/postgresql-96-centos7
  size: 1

▶ odo service create --from-file db.yaml

#  push can take a long time
▶ odo push --show-log

▶ curl --head http://http-8080-java-maven-spring-petcl-ddcj-tkral-test.apps-crc.testing/     
HTTP/1.1 200 
Content-Type: text/html;charset=UTF-8
Content-Language: en
Content-Length: 3161
Date: Wed, 02 Jun 2021 13:56:25 GMT
Set-Cookie: 3b7e1165bfaf6b2b1c0bed3e97f59d2f=24ebcaffe05531acc331c8abf0e28894; path=/; HttpOnly
Cache-control: private

Application is working and responding with 200

▶ odo link Database/postgresql

# wait for pod to restart and be in Running state again
▶ k get pods -w
NAME                                           READY   STATUS    RESTARTS   AGE
java-maven-spring-petcl-ddcj-58db4b8b8-jgls7   1/1     Running   0          15s
postgresql-85c4b4488b-pfll5                    1/1     Running   1          15m
postgresql-operator-6b67c45dfc-2vrcs           1/1     Running   0          15m

Application is not running, getting HTTP error 500

▶ curl --head http://http-8080-java-maven-spring-petcl-ddcj-tkral-test.apps-crc.testing/
HTTP/1.0 503 Service Unavailable
Pragma: no-cache
Cache-Control: private, max-age=0, no-cache, no-store
Connection: close
Content-Type: text/html

This is becuase there is no source code in the container

▶ k exec -it java-maven-spring-petcl-ddcj-58db4b8b8-jgls7 /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
Defaulted container "tools" out of: tools, copy-supervisord (init)
I have no name!@java-maven-spring-petcl-ddcj-58db4b8b8-jgls7:/projects$ ls -lah
total 0
drwxrwsrwx. 2 root 1000620000  6 Jun  2 13:58 .
dr-xr-xr-x. 1 root root       51 Jun  2 13:58 ..

If I try to run odo push -f to force push files it is not syncing any files.

▶ odo push -f
 ✓  Waiting for component to start [8ms]

Validation
 ✓  Validating the devfile [52090ns]

Creating Kubernetes resources for component java-maven-spring-petcl-ddcj
 ✓  Waiting for component to start [1ms]
 ✓  Waiting for component to start [1ms]

Applying URL changes
W0602 15:59:44.794071  326590 warnings.go:70] extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
 ✓  URLs are synced with the cluster, no changes are required.

Syncing to component java-maven-spring-petcl-ddcj
 ✓  Checking file changes for pushing [15ms]
 ✓  Syncing files to the component [225ms]

Executing devfile commands for component java-maven-spring-petcl-ddcj
 ✓  Waiting for component to start [2ms]
 ✗  Executing mvn-package command "mvn -Dmaven.repo.local=/home/user/.m2/repository package" [975ms]
 ✗  Failed to start component with name "java-maven-spring-petcl-ddcj". Error: Failed to create the component: command execution failed: unable to execute the run command: unable to exec command [/bin/sh -c mvn -Dmaven.repo.local=/home/user/.m2/repository package]: 
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.061 s
[INFO] Finished at: 2021-06-02T13:59:45Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/projects). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
: error while streaming command: command terminated with exit code 1

/kind bug

because result is not working application
/priority high

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.priority/HighImportant issue; should be worked on before any other issues (except priority/Critical issue(s)).

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions