Skip to content

Env values(long data type) defined in manifest.yml are converting to Float while storing in CloudFoundry #996

@Venkatesh-Ph

Description

@Venkatesh-Ph

High five for submitting a report!
If you found an issue with the cf CLI, please visit the releases page and confirm it's not fixed already in the latest release.
To avoid additional back and forth, please include the following details as relevant:

  • Command cf push

  • What occurred, incl. error and/or stack trace

I have application with manifest.yml(which has required details used by my appication) .

Manifest.yml

applications:

  • name: my-application
    memory: 1024M
    stack: cflinuxfs2
    instances: 1
    path: my_application.jar
    buildpack: https://github.com/pivotalservices/oracle-jre-java-buildpack.git
    env:
    JAVA_OPTS: '-DIMMEDIATE_PREFETCH=TRUE'
    JBP_CONFIG_JAVA_MAIN: '{java_main_class: "com.abc.MyApplication", arguments: "config.yml"}'
    MY_INTERFACE: 0.0.0.0
    MY_ACTOR_TIMEOUT: 21474835
    MY_MAX_MESSAGE_SIZE: 4000
    MY_MAX_FILE_SIZE: 128000000
    MY_VARIABLE:DEV
    services:
    -cf_space_name-mq

cf push went fine and my application got started and i am able to post request to my application without any issues.
But when i tried cf-env my-application , env values are shown converted to float and displayed as below (which is not expected to be).

User-Provided:
MY_ACTOR_TIMEOUT: 2.1474835e+07
MY_MAX_FILE_SIZE: 1.28e+08
MY_MAX_MESSAGE_SIZE: 4000

Later i tried changing the environment variable MY_VARIABLE to PROD using cf set-env my-application MY_VARIABLE PROD and did cf restage my-application.

then below is the exception we got and when we post any request to application its throwing 502:Bad Gateway .

Caused by: java.lang.NumberFormatException: For input string: "128000000.0"
OUT at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

  • What you expected to occur

Application should start without any error.

  • CLI Version

6.13.0-e68ce0f

  • CC API Endpoint Version
    see cf api output
    API version: 2.55.0

  • CF Trace, if issue relates to HTTP requests or strange behavior
    run the command with -v and paste or attach the trace output

  • Platform & Shell Details
    e.g. Mac OS X 10.11 iTerm, Windows 8.1 64-bit with PowerShell, Ubuntu 14.04.3 64-bit with gnome-terminal
    Mac OS X 10.10 , Windows 8.1 64-bit with PowerShell

  • Any other relevant information
    e.g. details of an environment, cf CLI version, flag or value it does work with, DNS/network configuration, etc.

NumberFormatException is not happening when we repush the application . It happens only if we change any env values and restage the existing application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions