Skip to content

Cross-account Object Store - Unable to Put #1895

Open
@rginon314

Description

@rginon314

Observed behavior

Hello team,
We are using API prefixes on CLI and nats.go server's to access Jetstream exported from one GP account to a SERVICE account.
We exposed Jetstream streams successfully.
We exposed Jetstream KV store successfully.
But once we have been to OBJ store we are unable to Put, all other commands works.
From what we saw, account SERVICE use API prefix at every step, but when uploading file metadata and chunks, there is no prefix use for $O.

We looked at KV store behavior and KV Put function use API Prefix when publishing to $KV.

We have replicated that behavior to object store and it works.

Expected behavior

With natscli or nats.go we should be able to use --js-api-prefix or jetstream.NewWithAPIPrefix to Put a file to an Object store located in a different account via export/import.

Server and client version

natscli: v0.2.3
nats-server: v2.10.25

Host environment

Linux 016492a1a016 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 Linux

Steps to reproduce

Export from GP ==> Import to GP

$JS.API.INFO ==> JS.GP.$JS.API.INFO
$JS.API.STREAM.> ==> JS.GP.$JS.API.STREAM.>
$JS.API.CONSUMER.> ==> JS.GP.$JS.API.CONSUMER.>
$JS.API.DIRECT.> ==> JS.GP.$JS.API.DIRECT.>
$KV.>==> JS.GP.$JS.API.$KV.>
$O.> ==> JS.GP.$JS.API.$O.>

#Create an object store from account SERVICE
nats --context dalon-gp-admin object add coucou

#Upload a new file to object store via SERVICE account
echo "123" > tests/toi.txt
nats --context dalon-service-admin object put coucou tests/toi.txt --js-api-prefix='JS.GP.$JS.API'

#Get the file from account GP
nats --context dalon-gp-admin object get coucou tests/toi.txt -O a -f && cat a

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectSuspected defect such as a bug or regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions