"to" function doesn't work at all

Hi folks! I tried to make simple flux query:

from(bucket: "prices") 
|> range(start: -1h) 
|> to(bucket: "bucket1")

I run: influx query -f ./query.flux
but got:

panic: interface conversion: interface {} is nil, not influxdb.StorageDependencies

goroutine 1 [running]:
github.com/influxdata/influxdb/v2/query/stdlib/influxdata/influxdb.GetStorageDependencies(...)
	/go/src/github.com/influxdata/influxdb/query/stdlib/influxdata/influxdb/dependencies.go:29
github.com/influxdata/influxdb/v2/query/stdlib/influxdata/influxdb.createToTransformation(0xa052e85a158438e2, 0x5cb03e6f5e5837b8, 0x0, 0x64bf940, 0xc0001607f8, 0x64e2b00, 0xc000a13cc0, 0xc00082d780, 0x400e8e6, 0xc000831c00, ...)
	/go/src/github.com/influxdata/influxdb/query/stdlib/influxdata/influxdb/to.go:241 +0x550
github.com/influxdata/flux/execute.(*createExecutionNodeVisitor).Visit(0xc000b247e0, 0x64f74c0, 0xc00016d4d0, 0x64f74c0, 0xc00016d830)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/execute/executor.go:210 +0x8db
github.com/influxdata/flux/plan.walk(0x64f74c0, 0xc00016d4d0, 0x62d12e8, 0xc00084b870, 0xc00084b6c8, 0xc00082bb00, 0x60)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/plan/walk.go:88 +0x19e
github.com/influxdata/flux/plan.(*Spec).BottomUpWalk(0xc000a13a00, 0xc00084b870, 0xc00082bb00, 0x531a2c0)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/plan/walk.go:60 +0x2fd
github.com/influxdata/flux/execute.(*executor).createExecutionState(0xc000160820, 0x64d9880, 0xc000a61530, 0xc000a13a00, 0xc000940780, 0x531a2c0, 0xc000160820, 0x64c2bc0)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/execute/executor.go:104 +0x18c
github.com/influxdata/flux/execute.(*executor).Execute(0xc000160820, 0x64d9880, 0xc000a61530, 0xc000a13a00, 0xc000940780, 0x7, 0x0, 0x0, 0x0)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/execute/executor.go:70 +0x5d
github.com/influxdata/flux/lang.(*Program).Start(0xc000a614a0, 0x64d9880, 0xc000a614d0, 0xc000940780, 0xc000a614d0, 0x64a4880, 0xc000a614a0, 0x0)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/lang/compiler.go:298 +0x1f8
github.com/influxdata/flux/repl.(*REPL).doQuery(0xc00082b4a0, 0x64d97c0, 0xc000a137c0, 0xc00016d320, 0x64e2a80, 0xc0003f7d40, 0x0, 0x0)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/repl/repl.go:229 +0x205
github.com/influxdata/flux/repl.(*REPL).executeLine(0xc00082b4a0, 0xc0007eed20, 0x47, 0x0, 0xc)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/repl/repl.go:188 +0x372
github.com/influxdata/flux/repl.(*REPL).Input(...)
	/go/pkg/mod/github.com/influxdata/flux@v0.69.2/repl/repl.go:134
main.fluxQueryF(0xc0007aa840, 0xc000b5a300, 0x0, 0x2, 0xc0008a1d68, 0x49a5d84)
	/go/src/github.com/influxdata/influxdb/cmd/influx/query.go:95 +0x30e
main.checkSetupRunEMiddleware.func1.1(0xc0007aa840, 0xc000b5a300, 0x0, 0x2, 0x0, 0x0)
	/go/src/github.com/influxdata/influxdb/cmd/influx/main.go:398 +0x74
github.com/spf13/cobra.(*Command).execute(0xc0007aa840, 0xc000b5a2e0, 0x2, 0x2, 0xc0007aa840, 0xc000b5a2e0)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000ea000, 0x0, 0x0, 0xc0000ea000)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
	/go/src/github.com/influxdata/influxdb/cmd/influx/main.go:39 +0x45

influxd “version”: “2.0.0-beta.13”

@victor-trx, org or orgID are required to write to InfluxDB 2.0, but this certainly should not result in a panic. It should return an error telling you to specify the organization. Can you create an issue for this on either the Flux or InfluxDB repository?

I found the same issue on github, looks like it doesn’t work only in repl or query. But if you do this via curl all works fine.