serverless / serverless-tencent

⚡️ 🐧 Serverless Tencent CLI 及中文讨论社区
https://cn.serverless.com
63 stars 26 forks source link

使用 serverless-tencent 部署的go云函数,无法运行 #197

Open wx2020 opened 2 years ago

wx2020 commented 2 years ago

BUG 描述:

使用 serverless-tencent 部署的腾讯云云函数,无法运行

复现步骤:

使用 serverless-tencent 部署 运行时为 Go 1的函数

预期结果:

函数正常运行

实际结果:

函数无法运行

调试信息:

环境版本 完整输出如下: ``` [2022-05-06 16:55:18] Started by user coding [2022-05-06 16:55:18] Running in Durability level: MAX_SURVIVABILITY [2022-05-06 16:55:19] [Pipeline] Start of Pipeline [2022-05-06 16:55:20] [Pipeline] node [2022-05-06 16:55:20] Running on Jenkins in /root/workspace [2022-05-06 16:55:20] [Pipeline] { [2022-05-06 16:55:20] [Pipeline] stage [2022-05-06 16:55:20] [Pipeline] { (检出) [2022-05-06 16:55:20] [Pipeline] checkout [2022-05-06 16:55:20] using credential 9ac27c1d-f6ce-468f-b9e5-2e8a9d569bb3 [2022-05-06 16:55:20] Cloning the remote Git repository [2022-05-06 16:55:20] Cloning repository git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:20] > git init /root/workspace # timeout=10 [2022-05-06 16:55:20] Fetching upstream changes from git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:20] > git --version # timeout=10 [2022-05-06 16:55:20] using GIT_SSH to set credentials [2022-05-06 16:55:20] > git fetch --tags --force --progress -- git@e.coding.net:wx2020/findmyip/qqwry.git +refs/heads/*:refs/remotes/origin/* [2022-05-06 16:55:21] > git config remote.origin.url git@e.coding.net:wx2020/findmyip/qqwry.git # timeout=10 [2022-05-06 16:55:21] > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 [2022-05-06 16:55:21] > git config remote.origin.url git@e.coding.net:wx2020/findmyip/qqwry.git # timeout=10 [2022-05-06 16:55:21] Fetching upstream changes from git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:21] using GIT_SSH to set credentials [2022-05-06 16:55:21] > git fetch --tags --force --progress -- git@e.coding.net:wx2020/findmyip/qqwry.git +refs/heads/*:refs/remotes/origin/* +refs/merge/*:refs/remotes/origin/merge/* [2022-05-06 16:55:21] > git rev-parse 78aef2f3603f5466c742f25110538b6cf662afbc^{commit} # timeout=10 [2022-05-06 16:55:21] Checking out Revision 78aef2f3603f5466c742f25110538b6cf662afbc (detached) [2022-05-06 16:55:21] > git config core.sparsecheckout # timeout=10 [2022-05-06 16:55:21] > git checkout -f 78aef2f3603f5466c742f25110538b6cf662afbc [2022-05-06 16:55:21] Commit message: "更新文件 scf_bootstrap" [2022-05-06 16:55:21] First time build. Skipping changelog. [2022-05-06 16:55:21] [Pipeline] } [2022-05-06 16:55:21] [Pipeline] // stage [2022-05-06 16:55:21] [Pipeline] stage [2022-05-06 16:55:21] [Pipeline] { (安装运行时) [2022-05-06 16:55:21] [Pipeline] sh [2022-05-06 16:55:22] + npm -v [2022-05-06 16:55:22] 6.14.4 [2022-05-06 16:55:22] + node -v [2022-05-06 16:55:22] v10.21.0 [2022-05-06 16:55:22] [Pipeline] sh [2022-05-06 16:55:22] + npm i -g n [2022-05-06 16:55:24] /usr/bin/n -> /usr/lib/node_modules/n/bin/n [2022-05-06 16:55:24] + n@8.2.0 [2022-05-06 16:55:24] added 1 package from 2 contributors in 1.173s [2022-05-06 16:55:24] + export NODE_MIRROR=http://mirrors.tencentyun.com/nodejs-release/ [2022-05-06 16:55:24] + n stable [2022-05-06 16:55:25] installing : node-v16.15.0 [2022-05-06 16:55:25] mkdir : /usr/local/n/versions/node/16.15.0 [2022-05-06 16:55:25] fetch : http://mirrors.tencentyun.com/nodejs-release/v16.15.0/node-v16.15.0-linux-x64.tar.xz [2022-05-06 16:55:27] copying : node/16.15.0 [2022-05-06 16:55:28] installed : v16.15.0 (with npm 8.5.5) [2022-05-06 16:55:28] [2022-05-06 16:55:28] Note: the node command changed location and the old location may be remembered in your current shell. [2022-05-06 16:55:28] old : /usr/bin/node [2022-05-06 16:55:28] new : /usr/local/bin/node [2022-05-06 16:55:28] If "node --version" shows the old version then start a new shell, or reset the location hash with: [2022-05-06 16:55:28] hash -r (for bash, zsh, ash, dash, and ksh) [2022-05-06 16:55:28] rehash (for csh and tcsh) [2022-05-06 16:55:28] + node -v [2022-05-06 16:55:28] v16.15.0 [2022-05-06 16:55:28] [Pipeline] sh [2022-05-06 16:55:28] + npm i -g npm [2022-05-06 16:55:32] [2022-05-06 16:55:32] removed 6 packages, changed 69 packages, and audited 202 packages in 4s [2022-05-06 16:55:32] [2022-05-06 16:55:32] 11 packages are looking for funding [2022-05-06 16:55:32] run `npm fund` for details [2022-05-06 16:55:32] [2022-05-06 16:55:32] found 0 vulnerabilities [2022-05-06 16:55:32] + npm -v [2022-05-06 16:55:32] 8.9.0 [2022-05-06 16:55:32] [Pipeline] } [2022-05-06 16:55:32] [Pipeline] // stage [2022-05-06 16:55:32] [Pipeline] stage [2022-05-06 16:55:32] [Pipeline] { (初始化预制环境变量) [2022-05-06 16:55:32] [Pipeline] sh [2022-05-06 16:55:33] + env [2022-05-06 16:55:33] JENKINS_HOME=/var/lib/jenkins [2022-05-06 16:55:33] GIT_COMMITTER_NAME=coding.net [2022-05-06 16:55:33] CI_BUILD_ID=20320892 [2022-05-06 16:55:33] JOB_ID=1316963 [2022-05-06 16:55:33] PROJECT_TOKEN_GK=****** [2022-05-06 16:55:33] GIT_PREVIOUS_SUCCESSFUL_COMMIT=e2219930bf8725bc5fdfc438566c39627d5fba87 [2022-05-06 16:55:33] GIT_REPO_URL=git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:33] MAIL=/var/mail/root [2022-05-06 16:55:33] GIT_AUTHOR_EMAIL=lcuwx2016@gmail.com [2022-05-06 16:55:33] PACKER_BIN=/root/programs/packer_1.6.0_linux_amd64 [2022-05-06 16:55:33] USER=root [2022-05-06 16:55:33] HELM_BIN=/root/programs/helm-v2.16.9-linux-amd64/linux-amd64 [2022-05-06 16:55:33] CI=true [2022-05-06 16:55:33] RUN_CHANGES_DISPLAY_URL=http://unconfigured-jenkins-location/job/cci-19674964-172753/1/display/redirect?page=changes [2022-05-06 16:55:33] INSTANCE_NAME=qqwry_api [2022-05-06 16:55:33] CI_BUILD_NUMBER=19 [2022-05-06 16:55:33] SHLVL=1 [2022-05-06 16:55:33] GIT_COMMIT=78aef2f3603f5466c742f25110538b6cf662afbc [2022-05-06 16:55:33] NODE_LABELS=master [2022-05-06 16:55:33] TERRAFORM_BIN=/root/programs/terraform_0.12.26_linux_amd64 [2022-05-06 16:55:33] HOME=/root [2022-05-06 16:55:33] GIT_SSH_URL=git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:33] GIT_LOCAL_BRANCH=master [2022-05-06 16:55:33] GRADLE_BIN=/root/programs/gradle-7.0.2/bin [2022-05-06 16:55:33] PACK_BIN=/root/programs/pack-v0.14.2-linux [2022-05-06 16:55:33] DOCKER_REGISTRY_CREDENTIALS_ID=105cf8d3-809a-499e-bd29-910b4c75e346 [2022-05-06 16:55:33] MAVEN_BIN=/root/programs/apache-maven-3.6.3/bin [2022-05-06 16:55:33] JENKINS_SERVER_COOKIE=durable-eaea33d8b70cee58f706e622dc5f25c1 [2022-05-06 16:55:33] GIT_AUTHOR_NAME=wx2020 [2022-05-06 16:55:33] PROJECT_API_URL=https://wx2020.coding.net/api/user/wx2020/project/ [2022-05-06 16:55:33] REGION=ap-shanghai [2022-05-06 16:55:33] HUDSON_COOKIE=3cfb9216-1ddc-4db9-aa8a-25c2e3ae17c8 [2022-05-06 16:55:33] LC_CTYPE=zh_CN.UTF-8 [2022-05-06 16:55:33] CCI_CURRENT_TEAM=wx2020 [2022-05-06 16:55:33] APP_NAME=qqwry [2022-05-06 16:55:33] GIT_HTTP_URL=https://e.coding.net/wx2020/findmyip/qqwry.git [2022-05-06 16:55:33] TENCENT_APP_ID=1253304549 [2022-05-06 16:55:33] BUILD_PACK_BIN=/root/programs/pack-v0.14.2-linux [2022-05-06 16:55:33] CI_ENV_FILE=/tmp/dynamic.env [2022-05-06 16:55:33] WORKSPACE=/root/workspace [2022-05-06 16:55:33] REF=refs/heads/master [2022-05-06 16:55:33] PROJECT_WEB_URL=https://wx2020.coding.net/p/findmyip [2022-05-06 16:55:33] FETCH_REF_SPECS=+refs/heads/*:refs/remotes/origin/* +refs/merge/*:refs/remotes/origin/merge/* [2022-05-06 16:55:33] NODE_NAME=master [2022-05-06 16:55:33] TRIGGER_USER_EMAIL=lcuwx2016@gmail.com [2022-05-06 16:55:33] LOGNAME=root [2022-05-06 16:55:33] PROJECT_NAME=findmyip [2022-05-06 16:55:33] HELM3_BIN=/root/programs/helm-v3.3.4-linux-amd64/linux-amd64 [2022-05-06 16:55:33] CREDENTIALS_ID=9ac27c1d-f6ce-468f-b9e5-2e8a9d569bb3 [2022-05-06 16:55:33] RBENV_BIN=/root/.rbenv/bin [2022-05-06 16:55:33] _=/usr/bin/daemon [2022-05-06 16:55:33] RUN_ARTIFACTS_DISPLAY_URL=http://unconfigured-jenkins-location/job/cci-19674964-172753/1/display/redirect?page=artifacts [2022-05-06 16:55:33] STAGE_NAME=初始化预制环境变量 [2022-05-06 16:55:33] GIT_BRANCH=origin/master [2022-05-06 16:55:33] EXECUTOR_NUMBER=41 [2022-05-06 16:55:33] XDG_SESSION_ID=c1 [2022-05-06 16:55:33] BUILD_DISPLAY_NAME=#1 [2022-05-06 16:55:33] RBENV_SHELL=su [2022-05-06 16:55:33] RUN_TESTS_DISPLAY_URL=http://unconfigured-jenkins-location/job/cci-19674964-172753/1/display/redirect?page=tests [2022-05-06 16:55:33] DEPOT_NAME=qqwry [2022-05-06 16:55:33] HUDSON_HOME=/var/lib/jenkins [2022-05-06 16:55:33] JOB_BASE_NAME=cci-19674964-172753 [2022-05-06 16:55:33] PATH=/root/.rbenv/shims:/root/programs/apache-maven-3.6.3/bin:/root/programs/go/bin:/root/programs/gradle-7.0.2/bin:/root/programs/helm-v2.16.9-linux-amd64/linux-amd64:/root/programs/helm-v3.3.4-linux-amd64/linux-amd64:/root/programs/packer_1.6.0_linux_amd64:/root/programs/terraform_0.12.26_linux_amd64:/usr/lib/jvm/java-8-openjdk-amd64/bin:/root/.rbenv/bin:/root/programs/rancher-v2.4.5:/root/go/bin:/root/programs/pack-v0.14.2-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin [2022-05-06 16:55:33] TENCENT_TEMP_SECRET_ID=****** [2022-05-06 16:55:33] TRIGGER_USER_NAME=wx2020 [2022-05-06 16:55:33] BUILD_ID=1 [2022-05-06 16:55:33] XDG_RUNTIME_DIR=/run/user/0 [2022-05-06 16:55:33] PROJECT_ID=10341615 [2022-05-06 16:55:33] STAGE=dev [2022-05-06 16:55:33] BUILD_TAG=jenkins-cci-19674964-172753-1 [2022-05-06 16:55:33] LANG=en_US.UTF-8 [2022-05-06 16:55:33] MVNW_REPOURL=http://mirrors.tencentyun.com/nexus/repository/maven-public/ [2022-05-06 16:55:33] GIT_URL=git@e.coding.net:wx2020/findmyip/qqwry.git [2022-05-06 16:55:33] BUILD_NUMBER=1 [2022-05-06 16:55:33] JENKINS_NODE_COOKIE=b17231d9-f8d8-4efb-8321-a815f605354f [2022-05-06 16:55:33] GOPROXY=http://mirrors.tencentyun.com/go/ [2022-05-06 16:55:33] CCI_JOB_NAME=更新qqwry服务至云函数 [2022-05-06 16:55:33] GOPATH_BIN=/root/go/bin [2022-05-06 16:55:33] RUNTIME=Go1 [2022-05-06 16:55:33] SHELL=/bin/bash [2022-05-06 16:55:33] GOPATH=/root/go [2022-05-06 16:55:33] RUN_DISPLAY_URL=http://unconfigured-jenkins-location/job/cci-19674964-172753/1/display/redirect [2022-05-06 16:55:33] CODING_ARTIFACTS_CREDENTIALS_ID=105cf8d3-809a-499e-bd29-910b4c75e346 [2022-05-06 16:55:33] TENCENT_TEMP_TOKEN=****** [2022-05-06 16:55:33] HUDSON_SERVER_COOKIE=4e043c37aa23be23 [2022-05-06 16:55:33] TRIGGER_USER_ID=839366 [2022-05-06 16:55:33] JOB_DISPLAY_URL=http://unconfigured-jenkins-location/job/cci-19674964-172753/display/redirect [2022-05-06 16:55:33] JAVA_BIN=/usr/lib/jvm/java-8-openjdk-amd64/bin [2022-05-06 16:55:33] ANDROID_SDK_ROOT=/root/programs/android-sdk [2022-05-06 16:55:33] CCI_TRIGGER_METHOD=PUSH [2022-05-06 16:55:33] GIT_COMMITTER_EMAIL=support@coding.net [2022-05-06 16:55:33] GIT_COMMIT_SHORT=78aef2f [2022-05-06 16:55:33] JOB_NAME=cci-19674964-172753 [2022-05-06 16:55:33] PWD=/root/workspace [2022-05-06 16:55:33] RANCHER_BIN=/root/programs/rancher-v2.4.5 [2022-05-06 16:55:33] JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 [2022-05-06 16:55:33] PROJECT_TOKEN=****** [2022-05-06 16:55:33] CCI_CURRENT_WEB_PROTOCOL=https [2022-05-06 16:55:33] ANDROID_HOME=/root/programs/android-sdk [2022-05-06 16:55:33] XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop [2022-05-06 16:55:33] TRIGGER_USER_GK=RnkOtULYxP [2022-05-06 16:55:33] GIT_PREVIOUS_COMMIT=e2219930bf8725bc5fdfc438566c39627d5fba87 [2022-05-06 16:55:33] CI_STORAGE_BUCKET_NAME=****** [2022-05-06 16:55:33] TENCENT_TEMP_SECRET_KEY=****** [2022-05-06 16:55:33] CCI_CURRENT_PROJECT_COMMON_CREDENTIALS_ID=105cf8d3-809a-499e-bd29-910b4c75e346 [2022-05-06 16:55:33] GIT_BUILD_REF=78aef2f3603f5466c742f25110538b6cf662afbc [2022-05-06 16:55:33] CCI_TASK_NAME=cci-19674964-172753 [2022-05-06 16:55:33] BRANCH_NAME=master [2022-05-06 16:55:33] CCI_CURRENT_DOMAIN=coding.net [2022-05-06 16:55:33] GO_BIN=/root/programs/go/bin [2022-05-06 16:55:33] [Pipeline] sh [2022-05-06 16:55:33] + date [2022-05-06 16:55:33] Fri May 6 16:55:33 CST 2022 [2022-05-06 16:55:33] [Pipeline] sh [2022-05-06 16:55:33] + echo TENCENT_SECRET_ID=****** [2022-05-06 16:55:33] [Pipeline] sh [2022-05-06 16:55:33] + echo TENCENT_SECRET_KEY=****** [2022-05-06 16:55:33] [Pipeline] sh [2022-05-06 16:55:34] + echo TENCENT_TOKEN=****** [2022-05-06 16:55:34] [Pipeline] sh [2022-05-06 16:55:34] + echo TENCENT_APP_ID=1253304549 [2022-05-06 16:55:34] [Pipeline] sh [2022-05-06 16:55:34] + echo SERVERLESS_PLATFORM_VENDOR=tencent [2022-05-06 16:55:34] [Pipeline] sh [2022-05-06 16:55:35] + echo SERVERLESS_PLATFORM_STAGE= [2022-05-06 16:55:35] [Pipeline] } [2022-05-06 16:55:35] [Pipeline] // stage [2022-05-06 16:55:35] [Pipeline] stage [2022-05-06 16:55:35] [Pipeline] { (安装 Severless 环境) [2022-05-06 16:55:35] [Pipeline] sh [2022-05-06 16:55:35] + npm install -g serverless-tencent [2022-05-06 16:55:53] [2022-05-06 16:55:53] added 407 packages, and audited 408 packages in 17s [2022-05-06 16:55:53] [2022-05-06 16:55:53] 41 packages are looking for funding [2022-05-06 16:55:53] run `npm fund` for details [2022-05-06 16:55:53] [2022-05-06 16:55:53] found 0 vulnerabilities [2022-05-06 16:55:53] [Pipeline] sh [2022-05-06 16:55:53] + slt -v [2022-05-06 16:55:54]  [2022-05-06 16:55:54] serverless ⚡tencent [2022-05-06 16:55:54]  [2022-05-06 16:55:54] serverless - tencent version: 3.21.6(npm) [2022-05-06 16:55:54]  [2022-05-06 16:55:54] [Pipeline] } [2022-05-06 16:55:54] [Pipeline] // stage [2022-05-06 16:55:54] [Pipeline] stage [2022-05-06 16:55:54] [Pipeline] { (编译 Go) [2022-05-06 16:55:54] [Pipeline] sh [2022-05-06 16:55:54] + GOOS=linux GOARCH=amd64 go build -o main [2022-05-06 16:55:55] go: downloading golang.org/x/text v0.3.2 [2022-05-06 16:55:55] go: downloading github.com/pquerna/ffjson v0.0.0-20181028064349-e517b90714f7 [2022-05-06 16:56:00] [Pipeline] } [2022-05-06 16:56:00] [Pipeline] // stage [2022-05-06 16:56:00] [Pipeline] stage [2022-05-06 16:56:00] [Pipeline] { (部署应用) [2022-05-06 16:56:00] [Pipeline] sh [2022-05-06 16:56:01] + mkdir src [2022-05-06 16:56:01] + mv main scf_bootstrap src [2022-05-06 16:56:01] + ls -al [2022-05-06 16:56:01] total 320 [2022-05-06 16:56:01] drwxr-xr-x 5 root root 4096 May 6 16:56 . [2022-05-06 16:56:01] drwx------ 23 root root 4096 May 6 16:55 .. [2022-05-06 16:56:01] -rw-r--r-- 1 root root 677 May 6 16:55 consts.go [2022-05-06 16:56:01] -rw-r--r-- 1 root root 1371 May 6 16:55 download.go [2022-05-06 16:56:01] -rw-r--r-- 1 root root 681 May 6 16:55 .env [2022-05-06 16:56:01] drwxr-xr-x 8 root root 4096 May 6 16:55 .git [2022-05-06 16:56:01] drwxr-xr-x 3 root root 4096 May 6 16:55 .github [2022-05-06 16:56:01] -rw-r--r-- 1 root root 338 May 6 16:55 .gitignore [2022-05-06 16:56:01] -rw-r--r-- 1 root root 142 May 6 16:55 go.mod [2022-05-06 16:56:01] -rw-r--r-- 1 root root 487 May 6 16:55 go.sum [2022-05-06 16:56:01] -rw-r--r-- 1 root root 1271 May 6 16:55 main.go [2022-05-06 16:56:01] -rw-r--r-- 1 root root 4854 May 6 16:55 qqwry.go [2022-05-06 16:56:01] -rw-r--r-- 1 root root 2767 May 6 16:55 README.md [2022-05-06 16:56:01] -rw-r--r-- 1 root root 1213 May 6 16:55 response.go [2022-05-06 16:56:01] -rw-r--r-- 1 root root 252062 May 6 16:55 screenshots.png [2022-05-06 16:56:01] -rw-r--r-- 1 root root 550 May 6 16:55 serverless.yml [2022-05-06 16:56:01] drwxr-xr-x 2 root root 4096 May 6 16:56 src [2022-05-06 16:56:01] -rw-r--r-- 1 root root 659 May 6 16:55 .travis.yml [2022-05-06 16:56:01] + ls -al src/ [2022-05-06 16:56:01] total 7928 [2022-05-06 16:56:01] drwxr-xr-x 2 root root 4096 May 6 16:56 . [2022-05-06 16:56:01] drwxr-xr-x 5 root root 4096 May 6 16:56 .. [2022-05-06 16:56:01] -rwxr-xr-x 1 root root 8102368 May 6 16:55 main [2022-05-06 16:56:01] -rw-r--r-- 1 root root 67 May 6 16:55 scf_bootstrap [2022-05-06 16:56:01] + slt deploy --debug [2022-05-06 16:56:01] [?25l正在初始化... [2022-05-06 16:56:02] Action: "deploy" - Stage: "dev" - App: "qqwry" - Name: "qqwry_api" [2022-05-06 16:56:02] 准备中... [2022-05-06 16:56:10] 上传中... [2022-05-06 16:56:11] 部署中... [2022-05-06 16:56:13] Creating bucket sls-cloudfunction-ap-shanghai-code-1253304549 [2022-05-06 16:56:14] Bucket sls-cloudfunction-ap-shanghai-code-1253304549 already exist. [2022-05-06 16:56:14] Setting lifecycle for bucket sls-cloudfunction-ap-shanghai-code-1253304549 [2022-05-06 16:56:14] Uploading code /scf_component_ag3tw9s-1651827372.zip to bucket sls-cloudfunction-ap-shanghai-code-1253304549 [2022-05-06 16:56:14] Uploading files to bucket sls-cloudfunction-ap-shanghai-code-1253304549 [2022-05-06 16:56:15] Updating function qqwry_api code, region ap-shanghai [2022-05-06 16:56:19] Updating function qqwry_api configure, region ap-shanghai [2022-05-06 16:56:22] Deploying triggers for function qqwry_api [2022-05-06 16:56:24] Api method ANY, path / already exist [2022-05-06 16:56:24] Api api-bo4rq18l updated [2022-05-06 16:56:24] Deploy api index success [2022-05-06 16:56:24] Releaseing service service-c2re38kp, environment release [2022-05-06 16:56:27] Deploy service service-c2re38kp success [2022-05-06 16:56:27] Adding tags for service-c2re38kp in ap-shanghai [2022-05-06 16:56:27] Updating tags [2022-05-06 16:56:27] Update tags success [2022-05-06 16:56:27] Deploy function qqwry_api success. [2022-05-06 16:56:27] Deploy SCF success [2022-05-06 16:56:28] type: web [2022-05-06 16:56:28] functionName: qqwry_api [2022-05-06 16:56:28] code: [2022-05-06 16:56:28] bucket: sls-cloudfunction-ap-shanghai-code [2022-05-06 16:56:28] object: /scf_component_ag3tw9s-1651827372.zip [2022-05-06 16:56:28] description: qqwry的api [2022-05-06 16:56:28] namespace: default [2022-05-06 16:56:28] runtime: Go1 [2022-05-06 16:56:28] handler: [2022-05-06 16:56:28] memorySize: 128 [2022-05-06 16:56:28] lastVersion: $LATEST [2022-05-06 16:56:28] traffic: 1 [2022-05-06 16:56:28] triggers: [2022-05-06 16:56:28] - [2022-05-06 16:56:28] NeedCreate: true [2022-05-06 16:56:28] created: true [2022-05-06 16:56:28] serviceId: service-c2re38kp [2022-05-06 16:56:28] serviceName: qqwry_api [2022-05-06 16:56:28] subDomain: service-c2re38kp-1253304549.sh.apigw.tencentcs.com [2022-05-06 16:56:28] protocols: https [2022-05-06 16:56:28] environment: release [2022-05-06 16:56:28] apiList: [2022-05-06 16:56:28] - [2022-05-06 16:56:28] path: / [2022-05-06 16:56:28] method: ANY [2022-05-06 16:56:28] apiName: index [2022-05-06 16:56:28] created: true [2022-05-06 16:56:28] authType: NONE [2022-05-06 16:56:28] businessType: NORMAL [2022-05-06 16:56:28] isBase64Encoded: false [2022-05-06 16:56:28] apiId: api-bo4rq18l [2022-05-06 16:56:28] internalDomain: [2022-05-06 16:56:28] url: https://service-c2re38kp-1253304549.sh.apigw.tencentcs.com/release/ [2022-05-06 16:56:28] url: https://service-c2re38kp-1253304549.sh.apigw.tencentcs.com [2022-05-06 16:56:28] urls: [2022-05-06 16:56:28] - https://service-c2re38kp-1253304549.sh.apigw.tencentcs.com/release/ [2022-05-06 16:56:28] 应用控制台: https://serverless.cloud.tencent.com/apps/qqwry/qqwry_api/dev [2022-05-06 16:56:28] 26s ›qqwry_api› 执行成功 [2022-05-06 16:56:28] [2022-05-06 16:56:29] [?25h [2022-05-06 16:56:29] [Pipeline] } [2022-05-06 16:56:29] [Pipeline] // stage [2022-05-06 16:56:29] [Pipeline] } [2022-05-06 16:56:29] [Pipeline] // node [2022-05-06 16:56:29] [Pipeline] End of Pipeline [2022-05-06 16:56:29] Finished: SUCCESS ```

serverless.yml 配置 ``` component: scf name: ${env:INSTANCE_NAME} org: ${env:TENCENT_APP_ID} app: ${env:APP_NAME} stage: ${env:STAGE} inputs: name: ${env:INSTANCE_NAME} namespace: default type: web region: ${env:REGION} src: ./src runtime: ${env:RUNTIME} description: qqwry的api timeout: '300' publicAccess: true events: - apigw: parameters: serviceName: qqwry_api protocols: - https environment: release endpoints: - path: / method: ANY ```

DEBUG 输出 ```yml # 添加环境变量 SLS_DEBUG=* 并重新执行命令,然后复制命令以及控制台输出粘贴在这里。 ```

额外信息

timqian commented 2 years ago

@wx2020 看到你运行结果日志,部署过程看起来没有什么问题。

日志中的 API gateway URL: https://service-c2re38kp-1253304549.sh.apigw.tencentcs.com/release/

这个URL 返回的错误消息是你代码中抛出的吗?如果是的话可以检查下这个错误涉及的相关逻辑

"errmsg":"请填写 IP 地址"