I exported a pulumi stack, made some hand edits an...
# general
c
I exported a pulumi stack, made some hand edits and tried to import it back, but getting following error
Copy code
error: could not deserialize deployment: unexpected end of JSON input
Any help/docs would be appreciated. I can confirm that the file is valid JSON
b
it would be very difficult to determine where the issue is, if you’re using the Pulumi service backend I recommend importing an old checkpoint
c
I am using S3 as a backend, I have a versioned s3 bucket, so I can still restore old state, but I want to make some changes to the state and import that
How can I debug this error ? @billowy-army-68599
b
there isn’t really an easy way, you’ve modified your JSON in a way that means Pulumi doesn’t recognise it anymore https://github.com/pulumi/pulumi/blob/931e392619dd4cf9d281af6cb15c5aacf0fdf812/pkg/backend/httpstate/state.go#L251 it might be valid JSON, but the it’s not valid to Pulumi
c
For some context, I have created a new component and moved some resources under there Changes I have made include , adding this new component in JSON, and changing the parent of resources to new one. Any clue where I could have gone wrong ? @billowy-army-68599
I am using golang, created new component using
Copy code
RegisterComponentResource
b
Again, if you’ve manually edited the JSON it’s going to be almost impossible to know
c
@billowy-army-68599 Is it possible to do the changes I want to do, with cli ? I can only see rename option, how to add a new resource ?
@billowy-army-68599 Seems like I’m trying to do something wrong, I exported the correct live stack and imported it back again without any changes and I’m still getting the same error
b
you mean the old checkpoint?
c
@billowy-army-68599 Thanks, I was able to fix it