cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open Venkatesh-Ph opened this issue 10 years ago • 4 comments

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.

Venkatesh-Ph avatar Nov 08 '16 10:11 Venkatesh-Ph

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/133914457

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Nov 08 '16 10:11 cf-gitbot

Hello @Venkatesh-Ph,

We are currently aware of this issue and are planning to revisit it at some later date, but a workaround you can perform for now is to write the actor timeout as a string (in quotes) inside the manifest. If you put quotes around your large numbers, the app should still push successfully.

Let us know if you have any other concerns and if it's okay to close this issue.

Regards, @jeffpak && @mmb CF CLI Team

jeffpak avatar Nov 09 '16 21:11 jeffpak

Thanks @jeffpak for your time on this.I too followed the same work-around and is working fine. I raised bug to bring this issue to your(CF CLI team) notice . As you are aware of this issue, closing the bug for now.

Venkatesh-Ph avatar Nov 10 '16 08:11 Venkatesh-Ph

This issue has now been resolved in cf CLI 6.23.0, so you would not need the work-around. https://github.com/cloudfoundry/cli#downloads

Regards, Dies Koper CF CLI PM

dkoper avatar Dec 22 '16 03:12 dkoper