Getting ERROR - Handle can not be created with null Persistent

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting ERROR - Handle can not be created with null Persistent

rgebbie

I have set up a simple Set Status job to look at the envionment name and if
it has "Prod" in it, return "Production".  It is getting
                                                                   
                                                                   
                                                                   
                                                                   
 ERROR - Handle can not be created with null Persistent            
                                                                   
                                                                   
                                                                   

Here is the script (all the import lines are my attempt to fix the issue):

import com.urbancode.anthill3.services.jobs.JobStatusEnum;
import com.urbancode.vcsdriver3.*;
import com.urbancode.anthill3.domain.ServerGroup.*;
import com.urbancode.anthill3.runtime.scripting.helpers.*;

Env = EnvironmentLookup.getCurrent().getName();
ProdEnv = Env.contains("Prod");

If (ProdEnv)
   {
       return "Production";
   }

So what incredibly stupid thing have I done?  Do I need to do something
before I can get the Environment name?  I have not been able to find any
reference to the error on the Web.

Thanks!
______________________________________________________
Ray Gebbie | Senior Release Engineer | macys.com
685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
line 8-118-002-1662

_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

AnthillizerDotCom
Check out http://anthillizer.com/pages/viewpage.action?pageId=2719760

Look at this one:  EnvironmentLookup.getCurrent().getShortName(). Read the comment beside it too.

I like using the "short name" rather than the full name.   Take a look at the configuration for an environment in Anthill and you will see a "short name" text field.
I use "dev", "uat", "prod" as short names.  These are also the names of the Statuses that I use in my LCM.  This way I can use the script above to set the status based upon the environment(short name) that I happen to be in.

Does this make sense?  

On Feb 6, 2013, at 7:49 PM, Ray Gebbie <[hidden email]> wrote:

>
> I have set up a simple Set Status job to look at the envionment name and if
> it has "Prod" in it, return "Production".  It is getting
>
>
>
>
> ERROR - Handle can not be created with null Persistent            
>
>
>
>
> Here is the script (all the import lines are my attempt to fix the issue):
>
> import com.urbancode.anthill3.services.jobs.JobStatusEnum;
> import com.urbancode.vcsdriver3.*;
> import com.urbancode.anthill3.domain.ServerGroup.*;
> import com.urbancode.anthill3.runtime.scripting.helpers.*;
>
> Env = EnvironmentLookup.getCurrent().getName();
> ProdEnv = Env.contains("Prod");
>
> If (ProdEnv)
>   {
>       return "Production";
>   }
>
> So what incredibly stupid thing have I done?  Do I need to do something
> before I can get the Environment name?  I have not been able to find any
> reference to the error on the Web.
>
> Thanks!
> ______________________________________________________
> Ray Gebbie | Senior Release Engineer | macys.com
> 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
> line 8-118-002-1662
>
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Eric Starr Anthillizer.com
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

Eric Minick-2
Did you get that error in a production environment? I'd expect to see it in
all your non-production environments. You don't return a value if ProdEnv
is false.

- the other Eric
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

rgebbie
It was with non-production.  I don't want to set a status at all for
non-production, so what do I return?  Or do I do an error exit?
______________________________________________________
Ray Gebbie | Senior Release Engineer | macys.com
685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
line 8-118-002-1662



|------------>
| From:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Eric Minick <[hidden email]>                                                                                                          |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |"AnthillPro user and support list." <[hidden email]>,                                                                    |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |02/06/2013 08:07 PM                                                                                                                       |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [Anthill-pro] Getting ERROR - Handle can not be created with null Persistent                                                        |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |[hidden email]                                                                                                   |
  >------------------------------------------------------------------------------------------------------------------------------------------|





Did you get that error in a production environment? I'd expect to see it in
all your non-production environments. You don't return a value if ProdEnv
is false.

- the other Eric
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro


_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

rgebbie
In reply to this post by AnthillizerDotCom
This is useful info.  But it does not really tell me why I am getting the
error.
______________________________________________________
Ray Gebbie | Senior Release Engineer | macys.com
685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
line 8-118-002-1662



|------------>
| From:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Eric Starr <[hidden email]>                                                                                                   |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |"AnthillPro user and support list." <[hidden email]>,                                                                    |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Cc:        |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |"[hidden email]" <[hidden email]>                                                                       |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |02/06/2013 07:33 PM                                                                                                                       |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [Anthill-pro] Getting ERROR - Handle can not be created with null Persistent                                                        |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |[hidden email]                                                                                                   |
  >------------------------------------------------------------------------------------------------------------------------------------------|





Check out http://anthillizer.com/pages/viewpage.action?pageId=2719760

Look at this one:  EnvironmentLookup.getCurrent().getShortName(). Read the
comment beside it too.

I like using the "short name" rather than the full name.   Take a look at
the configuration for an environment in Anthill and you will see a "short
name" text field.
I use "dev", "uat", "prod" as short names.  These are also the names of the
Statuses that I use in my LCM.  This way I can use the script above to set
the status based upon the environment(short name) that I happen to be in.

Does this make sense?

On Feb 6, 2013, at 7:49 PM, Ray Gebbie <[hidden email]> wrote:

>
> I have set up a simple Set Status job to look at the envionment name and
if

> it has "Prod" in it, return "Production".  It is getting
>
>
>
>
> ERROR - Handle can not be created with null Persistent
>
>
>
>
> Here is the script (all the import lines are my attempt to fix the
issue):

>
> import com.urbancode.anthill3.services.jobs.JobStatusEnum;
> import com.urbancode.vcsdriver3.*;
> import com.urbancode.anthill3.domain.ServerGroup.*;
> import com.urbancode.anthill3.runtime.scripting.helpers.*;
>
> Env = EnvironmentLookup.getCurrent().getName();
> ProdEnv = Env.contains("Prod");
>
> If (ProdEnv)
>   {
>       return "Production";
>   }
>
> So what incredibly stupid thing have I done?  Do I need to do something
> before I can get the Environment name?  I have not been able to find any
> reference to the error on the Web.
>
> Thanks!
> ______________________________________________________
> Ray Gebbie | Senior Release Engineer | macys.com
> 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
> line 8-118-002-1662
>
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro


_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

Steve Boone
Your set status step runs in all environments.  If you run the "set status"
step, it expects that it will be setting a status.  It's failing because
the step never gets a status to apply.  If you want to only set the status
in production, then you should consider writing a Job Precondition script
that only runs the job is the environment is Production.  Then, in your
apply status step, you just tell it to use "Production".

Does this make sense?

I think your scripting logis is at the "apply status" step level, and you
should be using it at the job precondition level.


On Thu, Feb 7, 2013 at 1:41 PM, Ray Gebbie <[hidden email]> wrote:

> This is useful info.  But it does not really tell me why I am getting the
> error.
> ______________________________________________________
> Ray Gebbie | Senior Release Engineer | macys.com
> 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
> line 8-118-002-1662
>
>
>
> |------------>
> | From:      |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |Eric Starr <[hidden email]>
>                                                                     |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | To:        |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |"AnthillPro user and support list." <[hidden email]>,
>                                                                    |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Cc:        |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |"[hidden email]" <[hidden email]>
>                                                                     |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Date:      |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |02/06/2013 07:33 PM
>                                                                   |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Subject:   |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |Re: [Anthill-pro] Getting ERROR - Handle can not be created with null
>      Persistent                                                        |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
> |------------>
> | Sent by:   |
> |------------>
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>   |[hidden email]
>                                                                     |
>
> >------------------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
>
> Check out http://anthillizer.com/pages/viewpage.action?pageId=2719760
>
> Look at this one:  EnvironmentLookup.getCurrent().getShortName(). Read the
> comment beside it too.
>
> I like using the "short name" rather than the full name.   Take a look at
> the configuration for an environment in Anthill and you will see a "short
> name" text field.
> I use "dev", "uat", "prod" as short names.  These are also the names of the
> Statuses that I use in my LCM.  This way I can use the script above to set
> the status based upon the environment(short name) that I happen to be in.
>
> Does this make sense?
>
> On Feb 6, 2013, at 7:49 PM, Ray Gebbie <[hidden email]> wrote:
>
> >
> > I have set up a simple Set Status job to look at the envionment name and
> if
> > it has "Prod" in it, return "Production".  It is getting
> >
> >
> >
> >
> > ERROR - Handle can not be created with null Persistent
> >
> >
> >
> >
> > Here is the script (all the import lines are my attempt to fix the
> issue):
> >
> > import com.urbancode.anthill3.services.jobs.JobStatusEnum;
> > import com.urbancode.vcsdriver3.*;
> > import com.urbancode.anthill3.domain.ServerGroup.*;
> > import com.urbancode.anthill3.runtime.scripting.helpers.*;
> >
> > Env = EnvironmentLookup.getCurrent().getName();
> > ProdEnv = Env.contains("Prod");
> >
> > If (ProdEnv)
> >   {
> >       return "Production";
> >   }
> >
> > So what incredibly stupid thing have I done?  Do I need to do something
> > before I can get the Environment name?  I have not been able to find any
> > reference to the error on the Web.
> >
> > Thanks!
> > ______________________________________________________
> > Ray Gebbie | Senior Release Engineer | macys.com
> > 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662 tie
> > line 8-118-002-1662
> >
> > _______________________________________________
> > Anthill-pro mailing list
> > [hidden email]
> > http://lists.urbancode.com/mailman/listinfo/anthill-pro
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
>
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro
Reply | Threaded
Open this post in threaded view
|

Re: Getting ERROR - Handle can not be created with null Persistent

rgebbie
Yes -- that makes sense.  I have just started doing that.  Thanks for the
reponse!
______________________________________________________
Ray Gebbie | Senior Release Engineer | macys.com
685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
line 8-118-002-1662



|------------>
| From:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Steve Boone <[hidden email]>                                                                                                           |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |"AnthillPro user and support list." <[hidden email]>,                                                                    |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |02/07/2013 11:57 AM                                                                                                                       |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [Anthill-pro] Getting ERROR - Handle can not be created with null Persistent                                                        |
  >------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Sent by:   |
|------------>
  >------------------------------------------------------------------------------------------------------------------------------------------|
  |[hidden email]                                                                                                   |
  >------------------------------------------------------------------------------------------------------------------------------------------|





Your set status step runs in all environments.  If you run the "set status"
step, it expects that it will be setting a status.  It's failing because
the step never gets a status to apply.  If you want to only set the status
in production, then you should consider writing a Job Precondition script
that only runs the job is the environment is Production.  Then, in your
apply status step, you just tell it to use "Production".

Does this make sense?

I think your scripting logis is at the "apply status" step level, and you
should be using it at the job precondition level.


On Thu, Feb 7, 2013 at 1:41 PM, Ray Gebbie <[hidden email]> wrote:

> This is useful info.  But it does not really tell me why I am getting the
> error.
> ______________________________________________________
> Ray Gebbie | Senior Release Engineer | macys.com
> 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662  tie
> line 8-118-002-1662
>
>
>
> |------------>
> | From:      |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |Eric Starr <[hidden email]>
>                                                                     |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

> |------------>
> | To:        |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |"AnthillPro user and support list." <[hidden email]>,
>                                                                    |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

> |------------>
> | Cc:        |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |"[hidden email]" <[hidden email]>
>                                                                     |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

> |------------>
> | Date:      |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |02/06/2013 07:33 PM
>                                                                   |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

> |------------>
> | Subject:   |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |Re: [Anthill-pro] Getting ERROR - Handle can not be created with null
>      Persistent                                                        |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

> |------------>
> | Sent by:   |
> |------------>
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>   |[hidden email]
>                                                                     |
>
>
>------------------------------------------------------------------------------------------------------------------------------------------|

>
>
>
>
>
> Check out http://anthillizer.com/pages/viewpage.action?pageId=2719760
>
> Look at this one:  EnvironmentLookup.getCurrent().getShortName(). Read
the
> comment beside it too.
>
> I like using the "short name" rather than the full name.   Take a look at
> the configuration for an environment in Anthill and you will see a "short
> name" text field.
> I use "dev", "uat", "prod" as short names.  These are also the names of
the
> Statuses that I use in my LCM.  This way I can use the script above to
set
> the status based upon the environment(short name) that I happen to be in.
>
> Does this make sense?
>
> On Feb 6, 2013, at 7:49 PM, Ray Gebbie <[hidden email]> wrote:
>
> >
> > I have set up a simple Set Status job to look at the envionment name
and

> if
> > it has "Prod" in it, return "Production".  It is getting
> >
> >
> >
> >
> > ERROR - Handle can not be created with null Persistent
> >
> >
> >
> >
> > Here is the script (all the import lines are my attempt to fix the
> issue):
> >
> > import com.urbancode.anthill3.services.jobs.JobStatusEnum;
> > import com.urbancode.vcsdriver3.*;
> > import com.urbancode.anthill3.domain.ServerGroup.*;
> > import com.urbancode.anthill3.runtime.scripting.helpers.*;
> >
> > Env = EnvironmentLookup.getCurrent().getName();
> > ProdEnv = Env.contains("Prod");
> >
> > If (ProdEnv)
> >   {
> >       return "Production";
> >   }
> >
> > So what incredibly stupid thing have I done?  Do I need to do something
> > before I can get the Environment name?  I have not been able to find
any
> > reference to the error on the Web.
> >
> > Thanks!
> > ______________________________________________________
> > Ray Gebbie | Senior Release Engineer | macys.com
> > 685 Market Str, 8th Floor | San Francisco, CA 94105 | (:415.422.1662
tie

> > line 8-118-002-1662
> >
> > _______________________________________________
> > Anthill-pro mailing list
> > [hidden email]
> > http://lists.urbancode.com/mailman/listinfo/anthill-pro
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
>
> _______________________________________________
> Anthill-pro mailing list
> [hidden email]
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
>
_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro


_______________________________________________
Anthill-pro mailing list
[hidden email]
http://lists.urbancode.com/mailman/listinfo/anthill-pro