/ 设置 10 秒超时 // 每日统计清 0 runtime_set('todaycomments', 0); runtime_set('todayarticles', 0); runtime_set('todayusers', 0); if ($forumlist) { $fidarr = array(); foreach ($forumlist as $fid => $forum) { $fidarr[] = $forum['fid']; } forum_update($fidarr, array('todayposts' => 0, 'todaythreads' => 0)); } // 清理临时附件 attach_gc(); // 当天24点 $today = strtotime(date('Ymd')) + 86400; runtime_set('cron_2_last_date', $today, TRUE); // 往前推8个小时,尽量保证在前一天 升级过来和采集的数据会很卡 // table_day_cron($time - 8 * 3600); cache_delete('cron_lock_2'); } } } ?>Google "gcloud functions deploy" command gives error gcloud crashed (TypeError): expected string or bytes-like|Concepts Of Algorithm

Google "gcloud functions deploy" command gives error gcloud crashed (TypeError): expected string or bytes-like

admin2025-04-22  2

I am trying to create cloud functions using my existing scripts
I run commands as shown below to create a cloud function <my_function>

"gcloud functions deploy <my_function> --no-gen2 --region=us-central1 - 
-entry-point=handle_event --memory=256MB --retry --runtime=python310 -- 
source=gs://<mybucket>/<myfunction.zip> -- 
timeout=30 --trigger-topic=<my pubsub> --set-env-vars=MYSQL_USER=<myuser>,MYSQL_PASSWORD=<mypass>,MYSQL_DATABASE=<mydb>,INSTANCE_CONNECTION_NAME=<myproject>:us-central1:<mydb>" --build-service-account=<mybuildservice account>

When I run this command I get an error "ERROR: gcloud crashed (TypeError): expected string or bytes-like object, got 'NoneType'"

gcloud does not throw any more information

I am stuck ; please help me resolve this error

I am trying to create cloud functions using my existing scripts
I run commands as shown below to create a cloud function <my_function>

"gcloud functions deploy <my_function> --no-gen2 --region=us-central1 - 
-entry-point=handle_event --memory=256MB --retry --runtime=python310 -- 
source=gs://<mybucket>/<myfunction.zip> -- 
timeout=30 --trigger-topic=<my pubsub> --set-env-vars=MYSQL_USER=<myuser>,MYSQL_PASSWORD=<mypass>,MYSQL_DATABASE=<mydb>,INSTANCE_CONNECTION_NAME=<myproject>:us-central1:<mydb>" --build-service-account=<mybuildservice account>

When I run this command I get an error "ERROR: gcloud crashed (TypeError): expected string or bytes-like object, got 'NoneType'"

gcloud does not throw any more information

I am stuck ; please help me resolve this error

Share Improve this question asked Jan 31 at 7:34 Yogesh DeviYogesh Devi 70914 silver badges35 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I ran the same command with verbosity set to debug as follows

enter code here
"gcloud functions deploy <my_function> --no-gen2 --region=us-central1 - 
-entry-point=handle_event --memory=256MB --retry --runtime=python310 -- 
source=gs://<mybucket>/<myfunction.zip> -- 
timeout=30 --trigger-topic=<my pubsub> --set-env-vars=MYSQL_USER= 
<myuser>,MYSQL_PASSWORD=<mypass>,MYSQL_DATABASE= 
<mydb>,INSTANCE_CONNECTION_NAME=<myproject>:us-central1:<mydb>" --build-service-account=<mybuildservice account> --verbosity=debug

And that gave me a exact problem behind error "please provide the build service account in the format projects/[project_id]/serviceaccounts/[service_account_email]]"

I was giving just the service account e-mail

After I corrected that to needed format the error went away

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745276212a293887.html

最新回复(0)