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

failed to add a file #338

Closed
samohyes opened this issue Jan 21, 2020 · 11 comments
Closed

failed to add a file #338

samohyes opened this issue Jan 21, 2020 · 11 comments

Comments

@samohyes
Copy link

There might be something wrong with the code. I build the lastest code locally and run

btfs daemon

The output is like this

~/work/blockchain/go-btfs$ btfs daemon
Initializing daemon...
go-btfs version: 1.0.0-dev-9f4b12e
Repo version: 7
System version: amd64/linux
Golang version: go1.13.3
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.1.67/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/199.168.139.56/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
WebUI: http://0.0.0.0:5001/webui
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Remote API server listening on /ip4/127.0.0.1/tcp/5101
Daemon is ready
Hosts info will be synced at [SCORE] mode
ipfs-shell: warning! unhandled response (500) encoding: text/html01:30:50.026 ERROR cmd/btfs: Get btfs id error, reasons: [id: unknown ipfs-shell error encoding: "text/html" - "\n\n <title>500 Internal Privoxy Error</title>\n <link rel="shortcut icon" href="http://config.privoxy.org/error-favicon.ico" type="image/x-icon">\n\n

500 Internal Privoxy Error

\n

Privoxy encountered an error while processing your request:

\n

Could not load template file no-server-data or one of its included components.

\n

Please contact your proxy administrator.

\n

If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It's typically the Privoxy install directory).

\n\n\n"] autoupdate.go:155

And then I tried the command

`
btfs add try.txt

01:29:56.842 ERROR cmds/http: could not guess encoding from content type "text/html" parse.go:217
Error: unknown error content type: text/html
`

So weird. Any help?

@tycm4109
Copy link
Contributor

@samohyes Hi, did you build release or master branch? It would be best to run the node according to https://docs.btfs.io/docs/btfs-demo documentation.

@samohyes
Copy link
Author

Yeah. I am using the master branch. I just download the source code and build the binary using the script install_btfs.sh. I know the doc you are pointing to. It uses some prebuilt binary. But I actually want to change the source code and build it myself.

@tycm4109
Copy link
Contributor

@samohyes Okay, I see. It's just that for us, the master branch is what we develop on. So we usually recommend users to use the stable release branch or pre-built binaries as its been tested many times. If you run into an issue on the release branch or pre-built binary, we can definitely log it for further bug fixing.

@samohyes
Copy link
Author

I don't know why. I tried the binary and deleted the ~/.btfs dir. Then everything seems fine now. Thanks for the help.

@samohyes
Copy link
Author

@tycm4109 emm, it looks like the problem is the 5001 port ui apis.
I am trying

`curl "http://localhost:5001/api/v0/id"

<title>500 Internal Privoxy Error</title>

500 Internal Privoxy Error

Privoxy encountered an error while processing your request:

Could not load template file no-server-data or one of its included components.

Please contact your proxy administrator.

If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It's typically the Privoxy install directory).

`

So the http apis fail me. And the btfs daemon outputs like this

btfs daemon
Initializing daemon...
go-btfs version: 1.0.0-dev-9f4b12e
Repo version: 7
System version: amd64/linux
Golang version: go1.13.3
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.1.67/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/199.168.139.56/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Remote API server listening on /ip4/127.0.0.1/tcp/5101
Daemon is ready
Hosts info will be synced at [SCORE] mode
23:52:06.065 ERROR cmd/btfs: Convert version2 from string to int error, reasons: [strconv.Atoi: parsing "0-dev": invalid syntax] autoupdate.go:377
23:52:06.065 ERROR cmd/btfs: Version compare error, reasons: [strconv.Atoi: parsing "0-dev": invalid syntax] autoupdate.go:172

@samohyes samohyes reopened this Jan 22, 2020
@richlee33
Copy link
Contributor

@samohyes can you try to change the URL to be:
http://localhost:5001/api/v1/id
we have recently changed the api version to 1.

@samohyes
Copy link
Author

@richlee33 Yeah. I tried again and the same thing happens. I can only use btfs add but no http api is working now.

curl "http://localhost:5001/api/v1/id"

<title>500 Internal Privoxy Error</title>

500 Internal Privoxy Error

Privoxy encountered an error while processing your request:

Could not load template file no-server-data or one of its included components.

Please contact your proxy administrator.

If you are the proxy administrator, please put the required file(s)in the (confdir)/templates directory. The location of the (confdir) directory is specified in the main Privoxy config file. (It's typically the Privoxy install directory).

@richlee33
Copy link
Contributor

@samohyes it seems like there is an issue with your machine resolving "localhost". perhaps its a firewall or proxy issue.
can you try instead of localhost to use the following addresses:
http://127.0.0.1:5001/api/v1/id
http://192.168.1.67:5001/api/v1/id
http://199.168.139.56:5001/api/v1/id
i gathered the ip addresses from the daemon output that was posted earlier.
thanks.

@samohyes
Copy link
Author

@richlee33 Still not working.. So sad...

@taiyangc
Copy link
Contributor

@samohyes That looks like a VPN configuration issue. Please try to turn off your VPN or bypass the local 127.0.0.1 domain. For more information: https://tinyurl.com/t8946pt

@samohyes
Copy link
Author

Cool. Exactly. Thanks.

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

4 participants