box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
229 stars 59 forks source link

--save isn't saving output to text or csv files #301

Closed adam801 closed 2 years ago

adam801 commented 2 years ago

Description of the Issue

When using the "box files:delete --bulk-file-path=C;\xxx --save" command, the output file is empty with the exception of one carriage return. I ran the command several times over the weekend, some with 170,000 lines of IDs to delete. The program took roughly 24 hours to complete, and each time, the output file only had one carriage return. I tried several options like using --quiet, --verbose, --yes, --csv but none of them produced an output file.

Steps to Reproduce

  1. open command prompt in windows (cmd)
  2. type "box files:delete --bulk-file-path= --save
  3. check the log folder location

One note is that I change the log folder location from the default to C:\BoxCLIReports. The csv/text files were being created in that folder but only with one carriage return, instead of the output from the command.

Expected Behavior

I expected a log file with all the deletions, files not found, files in trash, etc, that I was seeing on the screen

Error Message, Including Stack Trace

there wasn't an error that I could see. One of the final lines in the command before it finished said something about output written to log file, but only a carriage return existed in the file.

Screenshots

image

Versions Used

Box CLI: VERSION @box/cli/2.9.0 win32-x64 node-v14.16.0 Operating System: image

Attaching log file that was created from the test command I just ran ("files-delete-2022-04-06_11_18_21_726.txt") files-delete-2022-04-06_11_18_21_726.txt

Thanks.

antusus commented 2 years ago

Hi @adam801 ,

Thanks for submitting this Issue! We will take a look and get back to you ASAP!

@antusus

adam801 commented 2 years ago

Hi @antusus ,

Has there been an update? I just ran a CLI command to delete about 40 users in bulk and the --save function still did not work.

Thanks, Adam

antusus commented 2 years ago

Hi @adam801,

we have this story in backlog and we will have to find some time to work on it. The deletion of users should work though, but you just cannot get output generated by the CLI as I understand correctly?

adam801 commented 2 years ago

HI @antusus ,

Yes the CLI methods are functioning properly as far as file deletions, user functions, etc. It's just the log file isn't being written to properly. I understand it's not a huge issue, but it would be quite handy for me to keep the log files for my records in case I need to refer back to when an action was taken. Having that documentation would be a good thing.

Thanks, Adam

antusus commented 2 years ago

Hi @adam801,

I'm looking into the issue. When removing there is nothing to write to output. API returns no response so CLI is not producing any output in this case (https://developer.box.com/reference/delete-users-id/). This is expected behaviour.

When removing you have a list of IDs to remove. This list will be the report. And you can have empty output as a confirmation.