简体   繁体   English

无服务器框架中 go lang“aws-go”的默认模板不起作用

[英]the default template for go lang "aws-go" in the serverless framwork isn't working

hello everyone:) noob here, I am having trouble invoking pre-built aws-go template function that i have deployed using the serverless framework.大家好:) 菜鸟,我在调用我使用无服务器框架部署的预构建 aws-go 模板函数时遇到问题。

not sure if it's relevant but here some details about my system不确定它是否相关,但这里有一些关于我的系统的细节

                   -`                    malup@mangulangot 
                  .o+`                   ----------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: GV62 8RD REV:1.0 
               `+oooooo:                 Kernel: 6.0.12-arch1-1 
               -+oooooo+:                Uptime: 20 hours, 51 mins 
             `/:-:++oooo+:               Packages: 1578 (pacman) 
            `/++++/+++++++:              Shell: zsh 5.9 
           `/++++++++++++++:             Resolution: 1920x1200 
          `/+++ooooooooooooo/`           DE: GNOME 43.2 
         ./ooosssso++osssssso+`          WM: Mutter 
        .oossssso-````/ossssss+`         WM Theme: Adwaita 
       -osssssso.      :ssssssso.        Theme: Juno-v40 [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Adwaita [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: kitty 
   `/ossssso+/:-        -:/+osssso+-     CPU: Intel i5-8300H (8) @ 4.000GHz 
  `+sso+:-`                 `.-/+oso:    GPU: NVIDIA GeForce GTX 1050 Ti Mobile 
 `++:.                           `-/+/   GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 
 .`                                 `/   Memory: 11563MiB / 15842MiB 

i have我有

  • Nodejs: v19.0.0节点: v19.0.0
  • Go: go version go1.19.4 linux/amd64 go: go version go1.19.4 linux/amd64
  • aws cli: aws-cli/2.9.8 Python/3.9.11 Linux/6.0.12-arch1-1 exe/x86_64.arch prompt/off aws cli: aws-cli/2.9.8 Python/3.9.11 Linux/6.0.12-arch1-1 exe/x86_64.arch prompt/off
  • serverless framework:无服务器框架:
Framework Core: 3.25.1
Plugin: 6.2.2
SDK: 4.3.2

i keep getting this error message我不断收到此错误消息

{
    "errorType": "Runtime.ExitError",
    "errorMessage": "RequestId: ac441b76-f8af-4565-9d46-8d8849efdf9c Error: Runtime exited with error: exit status 1"
}
Environment: linux, node 19.0.0, framework 3.25.1, plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Invoked function failed

here are the exact steps i have taken to deploy the function/s,这是我部署功能所采取的确切步骤,

  1. created an IAM user name in aws console ui in the browser with Access key - Programmatic access as credential type使用Access key - Programmatic access
  2. clicked on Attach existing policies directly and checked the box for AdministratorAcess and finished creating the user单击Attach existing policies directly并选中AdministratorAcess框并完成创建用户
  3. ran aws configure and entered the运行aws configure并输入
    • AWS Access Key ID
    • AWS Secret Access Key
    • entered us-east-1 for the region输入该区域us-east-1
    • and entered json for the output format并为输出格式输入json
  4. ran serverless create -t aws-go -p backend to create a project structure called backend运行serverless create -t aws-go -p backend以创建一个名为backend的项目结构
  5. cd backend
  6. go mod init backend to create the mod file go mod init backend创建mod文件
  7. go mod tidy to resolve dependencies go mod tidy解决依赖关系
  8. make
  9. serverless deploy

no errors have occurred and everything seemed fine.没有发生任何错误,一切似乎都很好。 now i run serverless invoke -f hello and i get that error message现在我运行serverless invoke -f hello并收到该错误消息

if i click on the Test button from the aws lambda console for the function it also fails with this is as the log message如果我从 aws lambda 控制台单击“ Test ”按钮以获取该功能,它也会失败,这是日志消息

/var/task/bin/hello: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /var/task/bin/hello)
/var/task/bin/hello: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /var/task/bin/hello)
2022/12/17 21:44:41 exit status 1
/var/task/bin/hello: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /var/task/bin/hello)
/var/task/bin/hello: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /var/task/bin/hello)
2022/12/17 21:44:41 exit status 1
START RequestId: bdc3fd91-c5a8-4427-ab84-2eebba760853 Version: $LATEST
RequestId: bdc3fd91-c5a8-4427-ab84-2eebba760853 Error: Runtime exited with error: exit status 1
Runtime.ExitError
END RequestId: bdc3fd91-c5a8-4427-ab84-2eebba760853

how do i go about resolving this issue please help:(我该如何解决这个问题请帮助:(

solved by changing the make file according to the instructions on this forum https://forum.serverless.com/t/hello-world-results-in-internal-server-error/13447通过根据本论坛上的说明更改 make 文件来解决https://forum.serverless.com/t/hello-world-results-in-internal-server-error/13447

build:
    env CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/hello hello/main.go
    env CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o bin/world world/main.go

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM