<#2723 [BUG] Flytectl crashes on registration of w...
# flyte-github
c
#2723 [BUG] Flytectl crashes on registration of workflow definitions coming from flytekit-java Issue created by sbrunk Describe the bug Flytectl 0.6.5, when trying to register serialized task/workflow definitions serialized with flytekit-java/jflyte, crashes with a segfault:
Copy code
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1edd4ec]

goroutine 1 [running]:
<http://github.com/flyteorg/flytectl/cmd/register.hydrateIdentifier(0x0|github.com/flyteorg/flytectl/cmd/register.hydrateIdentifier(0x0>, {0x7ff7bfeff64c, 0x2}, 0x0)
        /home/runner/work/flytectl/flytectl/cmd/register/register_util.go:255 +0x2c
<http://github.com/flyteorg/flytectl/cmd/register.hydrateSpec({0x2f304c8|github.com/flyteorg/flytectl/cmd/register.hydrateSpec({0x2f304c8>?, 0xc000a6d7a0?}, {0x0, 0x0}, {{0x7ff7bfeff64c, 0x2}, 0x0, 0x0, 0x0, {0x0, ...}, ...})
        /home/runner/work/flytectl/flytectl/cmd/register/register_util.go:462 +0xdd
<http://github.com/flyteorg/flytectl/cmd/register.registerFile({0x2f3dc28|github.com/flyteorg/flytectl/cmd/register.registerFile({0x2f3dc28>, 0xc000120000}, {0x7ff7bfeff5e7, _}, {_, _, _}, {0x0, {0x0, 0x0}, ...}, ...)
        /home/runner/work/flytectl/flytectl/cmd/register/register_util.go:594 +0x488
<http://github.com/flyteorg/flytectl/cmd/register.Register({0x2f3dc28|github.com/flyteorg/flytectl/cmd/register.Register({0x2f3dc28>, 0xc000120000}, {0xc0003b3810?, 0x0?, 0x0?}, 0x3f20520, {0x0, {0x0, 0x0}, {0x0, ...}, ...})
        /home/runner/work/flytectl/flytectl/cmd/register/files.go:160 +0x6ca
<http://github.com/flyteorg/flytectl/cmd/register.registerFromFilesFunc(|github.com/flyteorg/flytectl/cmd/register.registerFromFilesFunc(>{0x2f3dc28, 0xc000120000}, {0xc0003b3810, 0x1, 0x7}, {0x0, {0x0, 0x0}, {0x0, 0x0}, ...})
        /home/runner/work/flytectl/flytectl/cmd/register/files.go:118 +0xcd
<http://github.com/flyteorg/flytectl/cmd/core.generateCommandFunc.func1(0xc000319180|github.com/flyteorg/flytectl/cmd/core.generateCommandFunc.func1(0xc000319180>?, {0xc0003b3810, 0x1, 0x7})
        /home/runner/work/flytectl/flytectl/cmd/core/cmd.go:65 +0x625
<http://github.com/spf13/cobra.(*Command).execute(0xc000319180|github.com/spf13/cobra.(*Command).execute(0xc000319180>, {0xc0003b37a0, 0x7, 0x7})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:852 +0x67c
<http://github.com/spf13/cobra.(*Command).ExecuteC(0xc00051db80)|github.com/spf13/cobra.(*Command).ExecuteC(0xc00051db80)>
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x39c
<http://github.com/spf13/cobra.(*Command).Execute(...)|github.com/spf13/cobra.(*Command).Execute(...)>
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
<http://github.com/flyteorg/flytectl/cmd.ExecuteCmd()|github.com/flyteorg/flytectl/cmd.ExecuteCmd()>
        /home/runner/work/flytectl/flytectl/cmd/root.go:137 +0x1e
main.main()
        /home/runner/work/flytectl/flytectl/main.go:12 +0x1d
Expected behavior flytectl should not crash. It should succeed or produce a useful error message if the input is invalid. Additional context to reproduce
Copy code
git clone <https://github.com/spotify/flytekit-java.git>
cd flytekit-java
git checkout 0.3.15 # we need to use the previous release as there is another issue currently with 0.3.16
mvn package -DskipTests=true

flytectl sandbox start # we need a sandbox because jflyte wants to upload jars even on serialize currently
cat <<EOF > .env.local
FLYTE_PLATFORM_URL=localhost:30081
FLYTE_AWS_ENDPOINT=<http://localhost:30084>
FLYTE_AWS_ACCESS_KEY_ID=minio
FLYTE_AWS_SECRET_ACCESS_KEY=miniostorage
FLYTE_STAGING_LOCATION=<s3://my-s3-bucket>
FLYTE_PLATFORM_INSECURE=True
EOF


mkdir  _pb_output
scripts/jflyte serialize workflows -cp=flytekit-examples-scala/target/lib -f  _pb_output

flytectl register files  _pb_output/* -d development  -p flytesnacks  --version v1 # segfault
Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte