You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time that any mc command is run, the following output is given:
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
Because of this, some situations cannot be automated properly due to this being returned when retrieving stdout from a command that just happens to be the first execution of mc (i.e. putting the output of an mc cat command into a variable. This is especially problematic with something like running an automated job pushing data through mc on a docker container with environment variables to control MC access.
Expected behavior
I think there are a few potential fixes, but without looking more I'm not positive what makes the most sense for this project:
Add an optional --quiet flag to filter out some "informational" messages like this.
Add an mc init command, to create this configuration without any other expected output.
Change sections that output informational messages (i.e. https://github.com/minio/mc/blob/master/cmd/main.go#L271) to use console.Errorln rather than console.Infoln, which should route these messages to stderr rather than stdout and allow users to filter to receive only the output they want.
Actual behavior
When run for the first time, or after removing config (i.e. rm -rf /root/.mc):
mc cat my_subdir/base_timestamp
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
<contents of file>
Results are the same with something like:
mc cat my_subdir/base_timestamp 2>/dev/null
mc: Configuration written to `/root/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/root/.mc/share`.
mc: Initialized share uploads `/root/.mc/share/uploads.json` file.
mc: Initialized share downloads `/root/.mc/share/downloads.json` file.
<contents of file>
Steps to reproduce the behavior
Start docker container w/ mc installed, and/or remove /root/.mc, and try running an mc command.
mc --version
Confirmed on both:
mc version RELEASE.2024-04-29T09-56-05Z
mc version RELEASE.2021-03-23T05-46-11Z
System information
Tested on rocky linux 9
The text was updated successfully, but these errors were encountered:
The first time that any mc command is run, the following output is given:
Because of this, some situations cannot be automated properly due to this being returned when retrieving stdout from a command that just happens to be the first execution of mc (i.e. putting the output of an
mc cat
command into a variable. This is especially problematic with something like running an automated job pushing data through mc on a docker container with environment variables to control MC access.Expected behavior
I think there are a few potential fixes, but without looking more I'm not positive what makes the most sense for this project:
mc init
command, to create this configuration without any other expected output.Actual behavior
When run for the first time, or after removing config (i.e.
rm -rf /root/.mc
):Results are the same with something like:
Steps to reproduce the behavior
Start docker container w/ mc installed, and/or remove /root/.mc, and try running an mc command.
mc --version
Confirmed on both:
System information
Tested on rocky linux 9
The text was updated successfully, but these errors were encountered: