一尘不染

在Linux上使用gaction更新Google Home / Assistant软件包时,Golang运行时会出现恐慌?

go

我正在尝试按照本教程中的说明在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操作说明:

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

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

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

但这会导致Golang恐慌崩溃,并带有以下堆栈跟踪:

    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 / Assistant应用正常运行?

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

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

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

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


阅读 181

收藏
2020-07-02

共1个答案

一尘不染

有可用的新gactions版本。尝试gactions selfupdate

如果由于版本已损坏而无法使用,请下载并运行旧版本。然后,此旧版本将更新为2.1.1,并且一切正常。

2020-07-02