You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Google Cloud Functions v1beta2 API version will be shut down on April 15, 2020
6
+
7
+
When you are using serverless to deploy google cloud functions with serverless google plugin v3 (Support google api v1),
8
+
It may face a error like
9
+
10
+
```
11
+
Deployment failed: TYPE_MISMATCH
12
+
Resource types cannot be changed, previous (cloudfunctions.v1beta2.function) -> updated (gcp-types/cloudfunctions-v1:projects.locations.functions)
13
+
```
14
+
15
+
Which means the former ones deployed used serverless-google-cloudfunctions v2, thus it failed to deploy.
16
+
First please be careful that
17
+
18
+
## Solutions
19
+
20
+
If you choose to upgrade to v1 function , and make sure the _package.json_ using the latest plugin in nodejs project
21
+
22
+
```json
23
+
"devDependencies": {
24
+
"serverless-google-cloudfunctions": "*"
25
+
},
26
+
```
27
+
28
+
There are two options to upgrade the exising cloud functions that deploy via _serverless-google-cloudfunctions v2_ (google api v1beta).
29
+
30
+
### Option 1
31
+
32
+
The first is from the devops point of view ,you don't need to change the code at all.
33
+
34
+
you need to open the [deployment manager](https://cloud.google.com/deployment-manager) in GCP.
35
+
36
+
-_Delete all the functions_
37
+
38
+
You have to delete all the functions and related bucket first ,and then delete the all the related resources from deployment manager
39
+
40
+
-_Delete all the related buckets with cloud functions_
41
+
42
+
By default, each time you you use `serverless deploy` , it would create a bucket for you to store the zip package for the function. pls delete this bucket first.
43
+
44
+
-_Delete all the function resources in deployment manager_
45
+
46
+
-_Redeploy the functions_
47
+
48
+
### Option 2
49
+
50
+
The second is from the developers' point of view , which means you need to make some changes to the `serverless.yml`.
51
+
52
+
- Change the service name or change the function name to make sure this function is different from the older one.
53
+
54
+
- Redeploy the functions.
55
+
56
+
- Once it's done,you may consider delete the old ones.
57
+
58
+
### Notices
59
+
60
+
Both the methods have some pros and cons, see the details from here:
61
+
62
+
1. If your functions are called by bucket or pubsub, the modification of the function name may not impact your business.
63
+
64
+
2. If your functions are called by http, the function name would be changed, which means the http url that need to be called may also be changed
65
+
66
+
3. If you use cloud function to store some important data, pls export these data first and then import them to a new bucket.
0 commit comments