ipfs/go-ds-s3

Error: error loading plugins: loading plugin /data/ipfs/plugins/go-ds-s3.so: not built with cgo support

Closed this issue · 11 comments

After

1- cloning the repo
2- run make build (getting as output s3plugin.so)
3- run make install
4- make the appropriate changes in both /data/ipfs/config

"Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
         "child": {
           "type": "s3ds",
           "region": "us-east-1",
           "bucket": "ipfs-test2-node",
           "accessKey": "******",
           "secretKey": "******"
        },
        "mountpoint": "/blocks",
        "prefix": "s3.datastore",
        "type": "measure"
       },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },

and /data/ipfs/datastore_spec,

{"mounts":[{"bucket":"ipfs-test2-node","mountpoint":"/blocks","region":"us-east-1","rootDirectory":""},{"mountpoint":"/","path":"datastore","type":"levelds"}],"type":"mount"}

I restarted ipfs sudo systemctl restart ipfs

and then while checking that didn't have errors

systemctl status ipfs

then got

Error: error loading plugins: loading plugin /data/ipfs/plugins/go-ds-s3.so: not built with cgo support

image

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

Do you have CGO_ENABLED=0 set in your environment? That'll break plugin builds.

Run make build CGO_ENABLED=1.

Fix in #214.

Merged. Please close this issue if it works, otherwise respond here.

That didn't solve the issue for me though...

image

Ah... sorry, I misinterpreted the source of the message.

The issue is that your go-ipfs version itself wasn't built with CGO support. How did you build/install go-ipfs?

I followed the next steps

  1. wget https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-386.tar.gz (download go-ipfs binary)

  2. tar xvfz go-ipfs_v0.9.1_linux-386.tar.gz (unpack the binary)

  3. rm go-ipfs_v0.9.1_linux-386.tar.gz (remove the downloaded archive)

  4. sudo mv go-ipfs/ipfs /usr/local/bin (move it to a particular folder)

  5. rm -rf go-ipfs (remove it from the other location)

  6. echo 'export IPFS_PATH=/data/ipfs' >>~/.bash_profile (add the IPFS repo path (/data/ipfs) to the .bash_profile script)

  7. source ~/.bash_profile (source what was done before (run the code contained in the file))

  8. sudo mkdir -p $IPFS_PATH (make sure to make the required directory)

  9. sudo chown ubuntu:ubuntu $IPFS_PATH (take ownership of the directory)

  10. ipfs init --profile server (initialize IPFS server)

Ah, I see. At the moment, plugins only work on 64bit Linux for the pre-built binaries (because they're built on 64bit linux and building go-ipfs with CGO support for foreign architectures is tricky). For now, you'll have to build go-ipfs from source or use the 64bit version (or use the go-ipfs docker container).

I've filed an issue to support this in our build system (ipfs/distributions#546).

(but please use the latest version, v0.9.1 is about 4 months out of date and is missing some important fixes)

@Stebalien while using an Ubuntu 20.04 (x86), if I change the first step to

wget https://dist.ipfs.io/go-ipfs/v0.11.0/go-ipfs_v0.11.0_linux-amd64.tar.gz

like you're suggesting, then eventually when initializing the IPFS server, this is what will get

ERROR   provider.queue  queue/queue.go:124      Failed to enqueue cid: leveldb: closed

image

This error would also happen using https://dist.ipfs.io/go-ipfs/v0.11.0/go-ipfs_v0.11.0_linux-386.tar.gz, yet according to hector

It is superficial and has no effect on the installation.

Anyways, I followed through with the procedure with go-ipfs_v0.11.0_linux-amd64 and in the end got into the following problem

image

There should be more to that error log. Hector is right, that error is a different bug (that shouldn't actually affect anything).