Rollback using doppler cli

Hello Team Doppler,

How can I Rollback using doppler cli? any ideas?

Hi @Dex!

Yep, you can! It’s a little hard to find because rollbacks are actually associated with logs rather than secrets. So, rather than rolling back a particular secret, you’re rolling back a change in the audit logs.

You can view your audit logs using this command:

doppler configs logs -p PROJECT -c CONFIG

Then, to perform a rollback, copy the log ID (which looks something like this: O1BNdCFtlJ8q1bxCoQhOIV0P), and use it in a command like this:

doppler configs logs rollback -p PROJECT -c CONFIG O1BNdCFtlJ8q1bxCoQhOIV0P

Let me know if you run into any issues!

Regards,
-Joel

Thank you so much watsonian. appreciate your reply.

Hi again so on the cli it cant show the before and after value?
per checking its shows only like this

Log Y7i5iUaxcSsM4dz4BOp16e5D
User: USERNAME username@companyname.com
Date: 2023-05-08 09:51:38.055 +0800 PST
Modified secrets and saved to vaultPreformatted text

not like on the ui you can see it.

@Dex You can view the diff, but you need to use doppler configs logs get -p PROJECT -c CONFIG [LOG_ID] to view it.

hello @watsonian,

I thinks there’s an issue regarding a rollback command if the value is a Across Project using secret referencing…

So here’s what I encouter on the config I update the Key-Value pair
from TEST=${test-project.env.REFERENCE_1} to TEST=value2

then I tried to get first the previous log_id then rollback it using the command that you gave

doppler configs logs rollback -p PROJECT -c [LOG_ID]

the output is like this

-TEST=value2
+TEST=

its blank.

then I run the command again with same log_id

-TEST=
+TEST=${test-project.env.REFERENCE_1}

Hi @Dex,

I couldn’t reproduce what you’re seeing. Here’s what happened in my test:

❯ doppler configs logs -p example -c dev
Log NsjHS2iReclIf3K7lKUnsCh4
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:37.222 -0500 CDT

	Modified secrets and saved to vault

Log G7L4WiYlQUOb0MbNs12TZVAi
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:30.142 -0500 CDT

	Modified secrets and saved to vault
....

❯ doppler configs logs -p example -c dev rollback NsjHS2iReclIf3K7lKUnsCh4
Log A3jjhxDqyusTgq9kYxSmYHO2
User: Joel Watson <joel.watson@doppler.com>
Date: 2023-05-11 09:54:52.514 -0500 CDT

	Modified secrets and saved to vault


-FOO=abcd
+FOO=${test.dev.TEST}

In NsjHS2iReclIf3K7lKUnsCh4 I changed the reference to the value abcd. In G7L4WiYlQUOb0MbNs12TZVAi I set the secret to the reference. I then rolled back NsjHS2iReclIf3K7lKUnsCh4 to revert the change and got the expected output.

The only thing I did notice in the command you posted was that you seemed to be passing the LOG_ID into the -c parameter, which should be taking the config name. Maybe that’s your issue here?

Regards,
-Joel