Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gaiad export"UnmarshalJSON cannot decode empty bytes" #3741

Closed
4 tasks
kimurayu45z opened this issue Feb 26, 2019 · 4 comments
Closed
4 tasks

gaiad export"UnmarshalJSON cannot decode empty bytes" #3741

kimurayu45z opened this issue Feb 26, 2019 · 4 comments

Comments

@kimurayu45z
Copy link
Contributor

Summary of Bug

$ gaiad export

Error

UnmarshalJSON cannot decode empty bytes

Steps to Reproduce

docker

FROM golang:1.11.5

RUN mkdir -p $HOME/go/bin
ENV GOPATH=$HOME/go
ENV GOBIN=$GOPATH/bin
ENV PATH=$PATH:$GOBIN

RUN mkdir -p $GOPATH/src/github.com/cosmos && \
    cd $GOPATH/src/github.com/cosmos && \
    git clone https://github.com/cosmos/cosmos-sdk && \
    cd cosmos-sdk && git checkout master && \
    make tools && make get_vendor_deps && make install

and then

$ gaiad init test
$ gaiad export

2019-02-26 1


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@cwgoes
Copy link
Contributor

cwgoes commented Feb 26, 2019

This is expected, since you haven't actually written any state yet (you'll need to run gaiad start first).

@jackzampolin
Copy link
Member

We should have a better error message here and maybe not panic.

@jackzampolin jackzampolin mentioned this issue Mar 1, 2019
1 task
@MarinX
Copy link
Contributor

MarinX commented Mar 1, 2019

can we modify subspace.go functions to return error instead of panic()?
I can make a valid PR for it...

@jackzampolin
Copy link
Member

@MarinX That would be a great PR! We would accept that. The core issue here was a broken isDBEmpty function which had an incorrect conditional. I've fixed that to eliminate this panic.

alessio pushed a commit that referenced this issue Apr 4, 2019
This is related to issue #3741 where fetching data from
invalid store, package panic.

Modify subspace.go to return errors instead of panic.

Also update other packages that import subspace and
handle errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants