Skip to content

odo dev --debug not starting the application with default Node.JS Devfile and starter project #6110

@rm3l

Description

@rm3l

/kind bug
/area dev

What versions of software are you using?

Operating System:
Fedora 36

Output of odo version:
odo v3.0.0-rc1 (6c6f8ef)

How did you run odo exactly?

odo init --name test-nodejs --devfile nodejs --starter nodejs-starter

odo dev --debug

Actual behavior

Looks like the Debug command fails to start.

❯ odo dev --debug                                                                                                                                                                                                                              
  __                                                                                                                                                                                                                                           
 /  \__     Developing using the test-nodejs Devfile                                                                                                                                                                                           
 \__/  \    Namespace: default                                                                                                                                                                                                                 
 /  \__/    odo version: v3.0.0-rc1                                                                                                                                                                                                            
 \__/                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                               
↪ Deploying to the cluster in developer mode                                                                                                                                                                                                   
 •  Waiting for Kubernetes resources  ...                                                                                                                                                                                                      
 ⚠  Pod is Pending                                                                                                                                                                                                                             
 ✓  Pod is Running                                                                                                                                                                                                                             
 ✓  Syncing files into the container [113ms]                                                                                                                                                                                                   
 ✓  Building your application in container on cluster (command: install) [3s]                                                                                                                                                                  
 •  Executing the application (command: debug)  ...                                                                                                                                                                                            
 ✗  Finished executing the application (command: debug) [530ms]                                                                                                                                                                                
 ⚠  Devfile command "debug" exited with an error status in 20 second(s)                                                                                                                                                                        
 ⚠  Last 100 lines of log:                                                                                                                                                                                                                     
npm WARN old lockfile                                                                                                                                                                                                                          
npm WARN old lockfile The package-lock.json file was created with an old version of npm,                                                                                                                                                       
npm WARN old lockfile so supplemental metadata must be fetched from the registry.                                                                                                                                                              
npm WARN old lockfile                                                                                                                                                                                                                          
npm WARN old lockfile This is a one-time fix-up, please be patient...                                                                                                                                                                          
npm WARN old lockfile                                                                                                                                                                                                                          
                                                                                                                                                                                                                                               
added 64 packages, and audited 65 packages in 3s                                                                                                                                                                                               
                                                                                                                                                                                                                                               
found 0 vulnerabilities                                                                                                                                                                                                                        
npm notice                                                                                                                                                                                                                                     
npm notice New minor version of npm available! 8.3.1 -> 8.19.1                                                                                                                                                                                 
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.19.1>                                                                                                                                                                        
npm notice Run `npm install -g [email protected]` to update!                                                                                                                                                                                          
npm notice                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                               
> [email protected] debug                                                                                                                                                                                                                   
> node --inspect=${DEBUG_PORT} server.js                                                                                                                                                                                                       
                                                                                                                                                                                                                                               
node: --inspect= requires an argument                                                                                                                                                                                                          
 -  Forwarding from 127.0.0.1:40004 -> 3000                                                                                                                                                                                                    
                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                               
Watching for changes in the current directory /tmp/nodejs                                                                                                                                                                                      
Press Ctrl+c to exit `odo dev` and delete resources from the cluster                                                                                                                                                                           

Expected behavior

The debug command should be running, so users can start debugging their application.

I didn't investigate that much, but per the error message (node: --inspect= requires an argument), it looks like the Devfile we downloaded from the registry does not have the DEBUG_PORT environment variable in the container component. So maybe this is an issue for the Devfile registry repo instead.

components:
- container:
    endpoints:
    - name: http-node
      targetPort: 3000
    image: registry.access.redhat.com/ubi8/nodejs-16:latest
    memoryLimit: 1024Mi
    mountSources: true
  name: runtime
metadata:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/initIssues or PRs related to `odo init`kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Status

    Done ✅

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions