Jovo deploy not working properly since v3

cli

#19

I did that and did not change it.

  • lambda STAGE environment variable is set to prod

  • config.prod.js exists with correct DB data

  • jovo deploy --stage prod -p alexaSkill -t lambda
    -> PROD skill is using dev database :frowning:

  • I changed the dev database login data in the config.js (my default) to nonsense login data

  • jovo deploy --stage prod -p alexaSkill -t lambda

  • PROD Skill returns Launch Error
    -> which means PROD skill is using the wrong config file

I am stock here :frowning:


#20

What happens if you try it locally?


#21

Hey @priyam_jain,

might I ask what you specify with stage dev?


#22

Hi I change the project id and endpoint. Actually no stage is for local, dev stage is for lambda.

The problem is the agent is not getting restored and I see the following error on GCP console :

Invalid argument (HTTP 400): INVALID_ARGUMENT


#23

Now I have started getting error for running for googleAction :

jovo build --deploy

I didn’t change anything in project.js, the same action is being deployed.

The error is :

Error: There was a problem:
 ›   Error: com.google.apps.framework.request.BadRequestException: Validate AgentModel failed because of the following reasons: AgentModel.defaultTimezone is required but was not 
 ›   provided
 ›   AgentModel.defaultTimezone  is not a supported timezone.
 ›   Validate entity failed because of the following reasons: '' is not a valid entity type ID. Must be a UUID.

#24

Take a look here:

https://community.jovo.tech/t/deploy-issue-dialogflow-time-zone-error/1021/5


#25

Thanks, it worked. Even that older issue with googleAction is resolved using the steps. But I doubt if the code was uploaded to lambda.


#26

Hi @jan and @rubenaeg
So this is annoying :frowning: Still havin the same issue, deploy is using the default config.js no matter what stage I define in the CLI.
My projects did not change and I have this issue with alle projects. STAGE-ENV in Lambda ist 100% correct, I did not change anything.
No one else is having this issue??

  • Config file name is “config.prod.js”
  • lambda variable is " STAGE -> prod "
  • deploy with “jovo deploy --stage prod -p alexaSkill -t lambda”

but it is using only the config.js. Which means I have to change the DB-Data in the default confog file all the time if I want to deploy to prod :frowning:

Thanks for advice, Jan


#27

I had the same issue, now I have settled with commenting uncommenting the db name every time I deploy.


#28

Hey everyone,
I know this is very annoying, since the rework of the CLI we have spotted some inconsistencies and old lines of code that should be refactored. As we are updating the CLI to work with the ask-cliv2, I will investigate your mentioned problems further and will hopefully find a fix soon! I’m sorry for the trouble!


#29

In your app logic, could you log both this.process.env.STAGE and this.getStage() to find out if there’s a problem how the Jovo app interprets the STAGE env variable?


#30

finally I was taking care of the issue again.
@jan :

  • Shouldn’t it be process.env.STAGE without this?
  • this.getStage() does not work for me, causes an error: this.getStage is not a function
  • And I see when I deploy without --target, the lambda upload gets skipped

So not progress so far, any other hints? Why is this.getStage() not working, even you are recommending this?
Thanks, jan


#31

Hey @developer.bs! Try this:

const {Project} = require('jovo-framework');
Project.getStage()

Here’s priorization of the env variables.

getStage() {
    return process.env.JOVO_STAGE || process.env.STAGE || process.env.NODE_ENV;
  }

#32

tried
const { App } = require('jovo-framework');
console.log(App.getStage());

got this:
App.getStage is not a function

When I log my process.env.STAGE variable I get the correct stage


#33

Use Project. instead of App.. This works as well app.getProject().getStage()


#34

thanks, app.getProject().getStage() works. But it returns the correct stage (prod) and the skill is still using the wrong config file (default: config.js) should use config.prod.js

any other ideas why?


#35

Does it happen in local development or on Lambda?


#36

I deploy to lambda, dev (default) and prod. variables there are correct. I have that issue on all my jovo projects since I updated to v3


#37

Hm, can’t reproduce. There were issues with merged config properties though. But that’s not Lambda related.

Here’s an example

config.js
image

config.production.js
image

In this case logging isn’t overridden completely. config.js is the base which is merged with config.production.js. Here for example, the used config will still have the `requestObjects’ array.
I understand that this approach has its disadvantages, but often it’s useful :slight_smile:

Could you post the relevant config parts of the config.js and the config.production.js?


#38

If anyone else is still getting this “AgentModel.defaultTimezone is required but was not provided” error, try adding a timezone, e.g. “America/Denver” in your project.json at googleAction.dialogFlow.agent.defaultTimezone