gpt4 book ai didi

json - 在 Linux 上使用 gaction 更新 Google Home/Assistant 包时 Golang runtime panic?

转载 作者:IT王子 更新时间:2023-10-29 01:41:18 25 4
gpt4 key购买 nike

我正在尝试使用本教程中的说明在 Linux 14.04 LTS 机器(而非 Windows)上构建我的第一个 Google Home 应用:

https://medium.com/google-cloud/building-your-first-action-for-google-home-in-30-minutes-ec6c65b7bd32

我的应用成功部署到 Google Cloud。但是,当我到达您使用模拟器测试您的应用程序的部分时,以下gactions 命令失败并显示消息“没有预览/模拟的帮助主题”

$ gactions preview --action_package action.json --invocation_name "three doors" --preview_mins 1234

No help topic for 'preview'

和:

$ gactions simulate

No help topic for 'simulate'

然后我尝试在此处切换到模拟器的 Google Actions 说明:

https://developers.google.com/actions/tools/simulator

该文档指示我使用以下命令上传我的 Actions 项目:

$ gactions update --action_package action.json --project three-doors-9898

但这会导致 Golang panic 崩溃并出现以下堆栈跟踪:

    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x506df6]

goroutine 1 [running]:
github.com/urfave/cli.HandleAction.func1(0xc4200fd208)
/usr/local/google/home/gkal/code/go/src/github.com/urfave/cli/app.go:478 +0x27a
panic(0x737b00, 0x960720)
/usr/lib/google-golang/src/runtime/panic.go:491 +0x283
github.com/Jeffail/gabs.(*Container).Bytes(0x0, 0x0, 0x0, 0x3000100)
/usr/local/google/home/gkal/code/go/src/github.com/Jeffail/gabs/gabs.go:459 +0x26
github.com/Jeffail/gabs.(*Container).String(0x0, 0xc420123350, 0x793672)
/usr/local/google/home/gkal/code/go/src/github.com/Jeffail/gabs/gabs.go:483 +0x2b
main.getLocaleFromActionPackage(0xc4203a60a0, 0xb, 0xc4203a60a0)
/usr/local/google/home/gkal/code/go/src/github.com/gkaldevrel/cli/gactions/gactions.go:605 +0xdf
main.commandUpdate.func1(0xc42008cf00)
/usr/local/google/home/gkal/code/go/src/github.com/gkaldevrel/cli/gactions/gactions.go:726 +0x209
reflect.Value.call(0x717fa0, 0x7a9988, 0x13, 0x793011, 0x4, 0xc4200fd1c8, 0x1, 0x1, 0xc4200fd150, 0x788860, ...)
/usr/lib/google-golang/src/reflect/value.go:434 +0x906
reflect.Value.Call(0x717fa0, 0x7a9988, 0x13, 0xc4200fd1c8, 0x1, 0x1, 0x614896, 0x7930f1, 0x4)
/usr/lib/google-golang/src/reflect/value.go:302 +0xa4
github.com/urfave/cli.HandleAction(0x717fa0, 0x7a9988, 0xc42008cf00, 0x0, 0x0)
/usr/local/google/home/gkal/code/go/src/github.com/urfave/cli/app.go:487 +0x17a
github.com/urfave/cli.Command.Run(0x793732, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7a4928, 0x4b, 0x0, ...)
/usr/local/google/home/gkal/code/go/src/github.com/urfave/cli/command.go:191 +0x9fd
github.com/urfave/cli.(*App).Run(0xc420001080, 0xc42000e0c0, 0x6, 0x6, 0x0, 0x0)
/usr/local/google/home/gkal/code/go/src/github.com/urfave/cli/app.go:240 +0x57d
github.com/urfave/cli.(*App).RunAndExitOnError(0xc420001080)
/usr/local/google/home/gkal/code/go/src/github.com/urfave/cli/app.go:257 +0x53
main.main()
/usr/local/google/home/gkal/code/go/src/github.com/gkaldevrel/cli/gactions/gactions.go:157 +0xa02

下面是我的包文件 (action.json),我使用 JSON 验证器对其进行了验证:

{
"versionLabel": "1.0",
"agentInfo": {
"languageCode": "en-US",
"projectId": "three-doors-9898",
"voiceName": "male_1"
},
"actions": [{
"description": "Launch intent",
"initialTrigger": {
"intent": "assistant.intent.action.MAIN"
},
"httpExecution": {
"url": "https://us-central1-three-doors-9898.cloudfunctions.net/three_doors"
}
}]
}

如何解决此问题并让我的 Google Home/智能助理应用正常运行?

更新:我使用的gactions版本来自这里:

我使用此页面上的 Linux/x86_64 链接来获取它:

https://developers.google.com/actions/tools/gactions-cli .

这可能是我系统的错误版本吗?我正在运行 Ubuntu 14.04 LTS,64 位版本。

最佳答案

有一个新的 gactions 版本可用。试试 gactions selfupdate

如果因为版本损坏而无法正常工作,请下载 old version并运行它。这个旧版本然后更新到 2.1.1,一切都恢复正常。

关于json - 在 Linux 上使用 gaction 更新 Google Home/Assistant 包时 Golang runtime panic?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46591266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com