GAM icon indicating copy to clipboard operation
GAM copied to clipboard

Initial GAM setup details included in csv stdout

Open mfcarroll opened this issue 6 months ago • 3 comments

I'm configuring gam in a containerized environment (google cloud run) and noticed that the first command I run includes some configuration steps gam has taken in the stdout. That resulted in my script attempting to process these lines as if they were csv lines in a subsequent step, which hadn't occurred when running locally.

Full steps to reproduce the issue:

  1. Install gam with very minimal set up, only the credential files copied in to the default location expected by gam (~/.gam/oauth2.txt etc) and no gam.cfg

  2. gam command from script: /usr/local/bin/gam redirect csv - print users fields primaryEmail

Expected outcome: Only csv output in stdout

Actual outcome: stdout includes additional lines, e.g.:

primaryEmail
[email protected]
[email protected]
[email protected]
Created: /root/.gam/gamcache
Created: /root/Downloads
Config File: /root/.gam/gam.cfg, Initialized

I added an initial gam command to my entrypoint script (that handles mounting the secrets) in order to trigger the setup, to more closely follow the installation instructions and work around this:

gam config drive_dir /tmp/GAMWork verify

...but everything else was functioning fine without needing that initialization, so that extra command doesn't seem to be technically necessary. My assumption is those output lines should probably be stderr instead of stdout?

I realise a fair answer is "I should initialize gam"... but in a case where someone doesn't, ending up with rogue lines on the end of what's assumed to be csv output seems less than ideal.

mfcarroll avatar Jun 23 '25 07:06 mfcarroll

Do this in the entrypoint script: gam config config_dir "~/.gam" drive_dir /tmp/GAMWork cache_dir /tmp/GAMCache save

Ross Scroggs @.***

On Jun 23, 2025, at 12:37 AM, Matthew Carroll @.***> wrote:

mfcarroll created an issue (GAM-team/GAM#1793) https://github.com/GAM-team/GAM/issues/1793 I'm configuring gam in a containerized environment (google cloud run) and noticed that the first command I run includes some configuration steps gam has taken in the stdout. That resulted in my script attempting to process these lines as if they were csv lines in a subsequent step, which hadn't occurred when running locally.

Full steps to reproduce the issue:

Install gam with very minimal set up, only the credential files copied in to the default location expected by gam (~/.gam/oauth2.txt etc) and no gam.cfg

gam command from script: /usr/local/bin/gam redirect csv - print users fields primaryEmail

Expected outcome: Only csv output in stdout

Actual outcome: stdout includes additional lines, e.g.:

primaryEmail @.*** @.*** @.*** Created: /root/.gam/gamcache Created: /root/Downloads Config File: /root/.gam/gam.cfg, Initialized I added an initial gam command to my entrypoint script (that handles mounting the secrets) in order to trigger the setup, to more closely follow the installation instructions and work around this:

gam config drive_dir /tmp/GAMWork verify

...but everything else was functioning fine without needing that initialization, so that extra command doesn't seem to be technically necessary. My assumption is those output lines should probably be stderr instead of stdout?

I realise a fair answer is "I should initialize gam"... but in a case where someone doesn't, ending up with rogue lines on the end of what's assumed to be csv output seems less than ideal.

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1793, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL7CVSGQU26QZDW63ML3E6VDRAVCNFSM6AAAAAB74SJP22VHI2DSMVQWIX3LMV43ASLTON2WKOZTGE3DOMJRG43DOMI. You are receiving this because you are subscribed to this thread.

taers232c avatar Jun 23 '25 14:06 taers232c

Thanks. I'll change that. It was working ok with just the drive_dir (and I assume using defaults for the others), I'll leave it to you to decide whether the stdout behaviour should be adjusted.

mfcarroll avatar Jun 24 '25 22:06 mfcarroll

Matthew,

I'm sticking with stdout for now.

Ross

Ross Scroggs @.***

On Jun 24, 2025, at 3:09 PM, Matthew Carroll @.***> wrote:

mfcarroll left a comment (GAM-team/GAM#1793) https://github.com/GAM-team/GAM/issues/1793#issuecomment-3002024918 Thanks. I'll change that. It was working ok with just the drive_dir (and I assume using defaults for the others), I'll leave it to you to decide whether the stdout behaviour should be adjusted.

— Reply to this email directly, view it on GitHub https://github.com/GAM-team/GAM/issues/1793#issuecomment-3002024918, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYLZ4HFV5TNS3VKRLE4D3FHEDLAVCNFSM6AAAAAB74SJP22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMBSGAZDIOJRHA. You are receiving this because you commented.

taers232c avatar Jun 24 '25 22:06 taers232c