Teevity / ice

AWS Usage Tool
2.86k stars 436 forks source link

Cannot get property 'x' on null object #233

Open ghost opened 7 years ago

ghost commented 7 years ago

(See second comment for reason this is not focussed on 'companyName' anymore.) When starting ICE, I get the following error via terminal and also on the web interface: URI /ice/dashboard/summary Class java.lang.NullPointerException Message Cannot get property 'companyName' on null object

image

My ice.properties file appears to be correct, from what I can see:

ice.reader=true ice.processor=true ice.processor.localDir=/mnt/ice_processor ice.work_s3bucketname=bucketname ice.work_s3bucketprefix=""

ice.startmillis=1364774400000

ice.companyName=CompanyName

whether or not to start reservation capacity poller

ice.reservationCapacityPoller=false

ice.reader=true ice.reader.localDir=/mnt/ice_reader

s3 bucket name where the billing files are. multiple bucket names are delimited by ",". Ice must have read access to billing s3 bucket.

ice.billing_s3bucketname=bucketname

prefix of the billing files. multiple prefixes are delimited by ","

ice.billing_s3bucketprefix=,

specify your payer account id here if across-accounts IAM role access is used. multiple account ids are delimited by ",". "ice.billing_payerAccountId=,222222222222" means assumed role access is only used for the second bucket.

ice.billing_payerAccountId=#######

specify the assumed role name here if you use IAM role access to read from billing s3 bucket. multiple role names are delimited by ",". "ice.billing_accessRoleName=,ice" means assumed role access is only used for the second bucket.

ice.billing_accessRoleName=,ice

s3 bucket name where Ice can store output files. Ice must have read and write access to billing s3 bucket.

ice.work_s3bucketname=bucketname-ice

ghost commented 7 years ago

FYI - I took the rather lame route of hard-coding the CompanyName into the main.gsp file. Resolved this particular flag, but just threw the error for the very next property in the list.

I'm really quite stumped as to what is causing this.

ghost commented 7 years ago

After hard-coding company name into main.gsp - I get the new property failing:

Error 2016-12-22 09:25:26,990 [http-nio-8080-exec-1] ERROR errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [GET] /ice/dashboard/summary Cannot get property 'resourceService' on null object. Stacktrace follows: Message: Error applying layout : main Line Method ->> 1142 runWorker in /grails-app/views/layouts/main.gsp
617 run in ''
^ 745 run . . . in ''
Caused by GroovyPagesException: Error processing GroovyPageView: Cannot get property 'resourceService' on null object ->> 57 runWorker in /grails-app/views/layouts/main.gsp
Caused by NullPointerException: Cannot get property 'resourceService' on null object ->> 50 doCall in opt_ice_grails_app_views_layouts_main_gsp$_run_closure2
77 run in opt_ice_grails_app_views_layouts_main_gsp
1142 runWorker in java.util.concurrent.ThreadPoolExecutor
617 run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 run . . . in java.lang.Thread
ghost commented 7 years ago

I also get the following when starting the service, maybe related?

| Running Grails application 2016-12-22 10:16:10,264 [main] INFO http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"] 2016-12-22 10:16:10,296 [main] INFO net.NioSelectorPool - Using a shared selector for servlet write/read 2016-12-22 10:16:10,312 [main] INFO core.StandardService - Starting service Tomcat 2016-12-22 10:16:10,316 [main] INFO core.StandardEngine - Starting Servlet Engine: Apache Tomcat/8.0.20 2016-12-22 10:16:10,436 [localhost-startStop-1] INFO core.StandardContext - Unable to set the web application class loader property [clearReferencesStatic] to [false] as the property does not exist. 2016-12-22 10:16:10,441 [localhost-startStop-1] INFO core.StandardContext - Unable to set the web application class loader property [clearReferencesStopThreads] to [false] as the property does not exist. 2016-12-22 10:16:10,441 [localhost-startStop-1] INFO core.StandardContext - Unable to set the web application class loader property [clearReferencesStopTimerThreads] to [false] as the property does not exist. 2016-12-22 10:16:10,441 [localhost-startStop-1] INFO core.StandardContext - Unable to set the web application class loader property [clearReferencesHttpClientKeepAliveThread] to [true] as the property does not exist. 2016-12-22 10:16:10,446 [localhost-startStop-1] INFO startup.ContextConfig - No global web.xml found 2016-12-22 10:16:10,602 [localhost-startStop-1] INFO [localhost].[/ice] - No Spring WebApplicationInitializer types detected on classpath 2016-12-22 10:16:10,632 [localhost-startStop-1] INFO [localhost].[/ice] - Initializing Spring root WebApplicationContext 2016-12-22 10:16:16,750 [localhost-startStop-1] INFO context.GrailsConfigUtils - [GrailsContextLoader] Grails application loaded.

rohiagra-capgemini commented 5 years ago

Hi, could you get this issue resolved by any chance?

nfonrose commented 5 years ago

Hi, Can you tell us more about how you are starting Ice and what your exact error message is? Also, it might be worth checking this fork which is very actively maintained: https://github.com/jimroth/ice