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

Cannot access public links #1276

Closed
dpakach opened this issue Jun 30, 2020 · 8 comments
Closed

Cannot access public links #1276

dpakach opened this issue Jun 30, 2020 · 8 comments

Comments

@dpakach
Copy link
Contributor

dpakach commented Jun 30, 2020

Steps to reproduce

  1. Setup ocis with EOS storage backend
  2. create a folder and its public link
  3. Try to access the public link with WebDAV API

Expected Result

  1. The public link should be accessible with the WebDAV API

Actual Result

  1. The public link is not accessible and gives a 401 Unauthorized error.
curl -XPROPFIND http://localhost:9140/remote.php/dav/public-files/aHjEwhAiytQV -v -u aHjEwhAiytQV

Enter host password for user 'aHjEwhAiytQV':
*   Trying 127.0.0.1:9140...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9140 (#0)
* Server auth using Basic with user 'aHjEwhAiytQV'
> PROPFIND /remote.php/dav/public-files/aHjEwhAiytQV HTTP/1.1
> Host: localhost:9140
> Authorization: Basic YUhqRXdoQWl5dFFWOg==
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none';
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< Date: Tue, 30 Jun 2020 02:47:48 GMT
< Content-Length: 0
< 
* Connection #0 to host localhost left intact

Server Logs

ocis            | 2020-06-30T02:53:48.669960460Z 2020-06-30T02:53:48Z INF skipping auth check for: /remote.php/dav/public-files/aHjEwhAiytQV pkg=rhttp service=reva traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.670052506Z 2020-06-30T02:53:48Z DBG http routing: head= tail=/remote.php/dav/public-files/aHjEwhAiytQV svc=root pkg=rhttp service=reva
ocis            | 2020-06-30T02:53:48.670275747Z 2020-06-30T02:53:48Z DBG http routing head=remote.php pkg=rhttp service=reva tail=/dav/public-files/aHjEwhAiytQV traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.670861299Z 2020-06-30T02:53:48Z DBG skipping auth method=/cs3.gateway.v1beta1.GatewayAPI/Authenticate pkg=rgrpc service=reva traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.672407039Z 2020-06-30T02:53:48Z DBG skipping auth method=/cs3.auth.registry.v1beta1.RegistryAPI/GetAuthProvider pkg=rgrpc service=reva traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.672443366Z 2020-06-30T02:53:48Z INF unary code=OK end="30/Jun/2020:02:53:48 +0000" from=tcp://127.0.0.1:50202 pkg=rgrpc service=reva start="30/Jun/2020:02:53:48 +0000" time_ns=145651 traceid=17e3ca1bdf955c8c8f137a2921070f4d uri=/cs3.auth.registry.v1beta1.RegistryAPI/GetAuthProvider user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T02:53:48.672454220Z 2020-06-30T02:53:48Z ERR gateway: error calling Authenticate for type: publicshares error="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:10054: connect: connection refused\"" pkg=rgrpc service=reva traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.672462803Z 2020-06-30T02:53:48Z WRN root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/gateway/authprovider.go:58 > error authenticating request error="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp 127.0.0.1:10054: connect: connection refused\"" pkg=rgrpc service=reva traceid=17e3ca1bdf955c8c8f137a2921070f4d
ocis            | 2020-06-30T02:53:48.672471238Z 2020-06-30T02:53:48Z INF unary code=OK end="30/Jun/2020:02:53:48 +0000" from=tcp://127.0.0.1:50200 pkg=rgrpc service=reva start="30/Jun/2020:02:53:48 +0000" time_ns=1489312 traceid=17e3ca1bdf955c8c8f137a2921070f4d uri=/cs3.gateway.v1beta1.GatewayAPI/Authenticate user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T02:53:48.672755968Z 2020-06-30T02:53:48Z WRN http end="30/Jun/2020:02:53:48 +0000" host=192.168.112.1 method=PROPFIND pkg=rhttp proto=HTTP/1.1 service=reva size=0 start="30/Jun/2020:02:53:48 +0000" status=401 time_ns=2522643 traceid=17e3ca1bdf955c8c8f137a2921070f4d uri=/remote.php/dav/public-files/aHjEwhAiytQV url=/remote.php/dav/public-files/aHjEwhAiytQV
ocis            | 2020-06-30T02:53:50.164534423Z 2020-06-30T02:53:50Z DBG Refreshing external service-registration service={"endpoints":[],"metadata":null,"name":"com.owncloud.reva","nodes":[{"address":"0.0.0.0:9142","id":"com.owncloud.reva-9658c1ca-6f0d-49b2-8b9d-566189f80129","metadata":{"broker":"http","protocol":"grpc","registry":"mdns","server":"grpc","transport":"grpc"}}],"version":""}

@dpakach
Copy link
Contributor Author

dpakach commented Jun 30, 2020

Looks like the reva-storage-public-link service was not running in my setup. Now that I have enabled that, I gets 500 error instead of there 401.
with the following server log

ocis            | 2020-06-30T05:24:40.837284862Z 2020-06-30T05:24:40Z WRN root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/storageprovider/storageprovider.go:457 > file not found pkg=rgrpc service=reva traceid=47c8e45a3f303743e0761e74ee32bdb8
ocis            | 2020-06-30T05:24:40.837295361Z 2020-06-30T05:24:40Z INF unary code=OK end="30/Jun/2020:05:24:40 +0000" from=tcp://127.0.0.1:40790 pkg=rgrpc service=reva start="30/Jun/2020:05:24:40 +0000" time_ns=46687010 traceid=47c8e45a3f303743e0761e74ee32bdb8 uri=/cs3.storage.provider.v1beta1.ProviderAPI/Stat user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T05:24:40.837849931Z 2020-06-30T05:24:40Z INF unary code=OK end="30/Jun/2020:05:24:40 +0000" from=tcp://127.0.0.1:49626 pkg=rgrpc service=reva start="30/Jun/2020:05:24:40 +0000" time_ns=48196838 traceid=47c8e45a3f303743e0761e74ee32bdb8 uri=/cs3.gateway.v1beta1.GatewayAPI/Stat user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T05:24:40.838459124Z 2020-06-30T05:24:40Z ERR runtime error: invalid memory address or nil pointer dereference pkg=rgrpc service=reva stack="goroutine 1136 [running]:\nruntime/debug.Stack(0x100000000000000, 0xc000777200, 0xc00157d280)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/cs3org/reva/internal/grpc/interceptors/recovery.recoveryFunc(0x34ed280, 0xc000e66990, 0x2c53ee0, 0x497a8a0, 0x11930da, 0xc00157d2e4)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/recovery/recovery.go:48 +0x34\ngithub.com/grpc-ecosystem/go-grpc-middleware/recovery.recoverFrom(0x34ed280, 0xc000e66990, 0x2c53ee0, 0x497a8a0, 0x30fde18, 0xc0000c2ea0, 0x0)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:53 +0x5a\ngithub.com/grpc-ecosystem/go-grpc-middleware/recovery.UnaryServerInterceptor.func1.1(0x34ed280, 0xc000e66990, 0xc00070b6e8, 0xc0000c34d0)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:27 +0x77\npanic(0x2c53ee0, 0x497a8a0)\n\t/usr/local/go/src/runtime/panic.go:969 +0x166\ngithub.com/cs3org/reva/internal/grpc/services/publicstorageprovider.(*service).Stat(0xc000eac240, 0x34ed280, 0xc000e67350, 0xc0003b6870, 0x0, 0x0, 0x0)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/services/publicstorageprovider/publicstorageprovider.go:178 +0x5be\ngithub.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1._ProviderAPI_Stat_Handler.func1(0x34ed280, 0xc000e67200, 0x2ef1040, 0xc0003b6870, 0x2b2ff00, 0xc000679ef0, 0x34ed280, 0xc000e67200)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/cs3/storage/provider/v1beta1/provider_api.pb.go:3960 +0x89\ngithub.com/cs3org/reva/internal/grpc/interceptors/auth.NewUnary.func1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7200, 0x0, 0x0, 0x0, 0x0)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/auth/auth.go:115 +0xa20\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0xc000e66570, 0x8, 0x4e66af0, 0x0)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63\ngithub.com/grpc-ecosystem/go-grpc-middleware/recovery.UnaryServerInterceptor.func1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7220, 0x0, 0x0, 0x0, 0x0)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/recovery/interceptors.go:31 +0xbc\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0xc00003ce00, 0x7f05d4a5e560, 0x0, 0xc0004f7300)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63\ngithub.com/cs3org/reva/internal/grpc/interceptors/log.NewUnary.func1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7240, 0x0, 0xc0004f72e0, 0x1, 0x1)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/log/log.go:39 +0x9b\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x34ed280, 0xc000e66990, 0x2ef1040, 0xc0003b6870, 0x2, 0x34ed280, 0xc000e66990, 0xc000e66960)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63\ngithub.com/cs3org/reva/internal/grpc/interceptors/token.NewUnary.func1(0x34ed280, 0xc000e66930, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7260, 0x2fd7840, 0xc0000814a0, 0x34ed280, 0xc000e66930)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/token/token.go:44 +0xb4\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x34ed280, 0xc000e66930, 0x2ef1040, 0xc0003b6870, 0xc000e66930, 0xc00125e000, 0x4b, 0x1f4)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63\ngithub.com/cs3org/reva/internal/grpc/interceptors/appctx.NewUnary.func1(0x34ed280, 0xc000e668d0, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7280, 0x22b237a, 0x2e16160, 0xc0004f72a0, 0xc0004f71e0)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/internal/grpc/interceptors/appctx/appctx.go:36 +0x4f8\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1(0x34ed280, 0xc000e668d0, 0x2ef1040, 0xc0003b6870, 0xc00009ac00, 0xc0004f71a0, 0xc00125bb08, 0x112b238)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:25 +0x63\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1(0x34ed280, 0xc000e668d0, 0x2ef1040, 0xc0003b6870, 0xc0004f71e0, 0xc0004f7200, 0xc001239b78, 0x11cb118, 0x2e8a9a0, 0xc000e668d0)\n\t/root/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/chain.go:34 +0xd5\ngithub.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1._ProviderAPI_Stat_Handler(0x300d160, 0xc000eac240, 0x34ed280, 0xc000e668d0, 0xc0000813e0, 0xc0000a2510, 0x34ed280, 0xc000e668d0, 0xc0015362d0, 0x47)\n\t/root/go/pkg/mod/github.com/cs3org/[email protected]/cs3/storage/provider/v1beta1/provider_api.pb.go:3962 +0x14b\ngoogle.golang.org/grpc.(*Server).processUnaryRPC(0xc000eae300, 0x3506fa0, 0xc00043c000, 0xc00009ac00, 0xc0000a26c0, 0x49937c0, 0x0, 0x0, 0x0)\n\t/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1024 +0x501\ngoogle.golang.org/grpc.(*Server).handleStream(0xc000eae300, 0x3506fa0, 0xc00043c000, 0xc00009ac00, 0x0)\n\t/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1313 +0xd3d\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000043670, 0xc000eae300, 0x3506fa0, 0xc00043c000, 0xc00009ac00)\n\t/root/go/pkg/mod/google.golang.org/[email protected]/server.go:722 +0xa1\ncreated by google.golang.org/grpc.(*Server).serveStreams.func1\n\t/root/go/pkg/mod/google.golang.org/[email protected]/server.go:720 +0xa1\n" traceid=47c8e45a3f303743e0761e74ee32bdb8
ocis            | 2020-06-30T05:24:40.838506128Z 2020-06-30T05:24:40Z ERR unary code=Internal end="30/Jun/2020:05:24:40 +0000" from=tcp://127.0.0.1:50430 pkg=rgrpc service=reva start="30/Jun/2020:05:24:40 +0000" time_ns=161740269 traceid=47c8e45a3f303743e0761e74ee32bdb8 uri=/cs3.storage.provider.v1beta1.ProviderAPI/Stat user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T05:24:40.839556955Z 2020-06-30 05:24:40.839212 I | Error when uploading spans to Jaeger: Post "http://localhost:14268/api/traces": dial tcp 127.0.0.1:14268: connect: connection refused
ocis            | 2020-06-30T05:24:40.840792453Z 2020-06-30T05:24:40Z ERR unary code=Internal end="30/Jun/2020:05:24:40 +0000" from=tcp://127.0.0.1:54518 pkg=rgrpc service=reva start="30/Jun/2020:05:24:40 +0000" time_ns=163076371 traceid=47c8e45a3f303743e0761e74ee32bdb8 uri=/cs3.gateway.v1beta1.GatewayAPI/Stat user-agent=grpc-go/1.26.0
ocis            | 2020-06-30T05:24:40.840837716Z 2020-06-30T05:24:40Z ERR error sending grpc stat request error="rpc error: code = Internal desc = runtime error: invalid memory address or nil pointer dereference" pkg=rhttp service=reva traceid=47c8e45a3f303743e0761e74ee32bdb8
ocis            | 2020-06-30T05:24:40.840842846Z 2020-06-30T05:24:40Z ERR http end="30/Jun/2020:05:24:40 +0000" host=172.22.0.1 method=PUT pkg=rhttp proto=HTTP/1.1 service=reva size=0 start="30/Jun/2020:05:24:40 +0000" status=500 time_ns=333192241 traceid=47c8e45a3f303743e0761e74ee32bdb8 uri=/remote.php/dav/public-files/uXNxtdfMuXfb/whateverfilefortesting-new-publicWebDAVAPI.txt url=/remote.php/dav/public-files/uXNxtdfMuXfb/whateverfilefortesting-new-publicWebDAVAPI.txt

@PVince81
Copy link
Contributor

Seems the Stat fails github.com/cs3org/reva/internal/grpc/services/publicstorageprovider.(*service).Stat(0xc000eac240, 0x34ed280, 0xc000e67350, 0xc0003b6870, 0x0, 0x0, 0x0)

As far as I can see the storage provider said "file not found" so there could be two bugs:

  • error handling for "file not found" should not result in a nil pointer error
  • issue with accessing public share source on EOS

@PVince81
Copy link
Contributor

@dpakach did you try recreating the public share after enabling the service ? I noticed that sometimes when a service is down during share creation, the share itself seems to be in a broken state even after enabling the service.

@PVince81
Copy link
Contributor

PVince81 commented Jul 13, 2020

I justed tried with ocis master (beta8) and accessing the public link share works using the web UI (Phoenix / ocis-web) and EOS.

However creating a folder gives an error, but the folder is still created after refresh. Could be a different issue.

Please recheck.

@PVince81
Copy link
Contributor

creating a folder is an unrelated issue, raised here: owncloud/web#3768

@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@refs refs changed the title [EOS] Cannot access public links annot access public links Jan 18, 2021
@refs refs changed the title annot access public links Cannot access public links Jan 18, 2021
@settings settings bot removed the Storage:EOS label Jan 29, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@pascalwengerter
Copy link
Contributor

@dpakach could you re-check (web issue has been resolved) and close this issue if applicable?

@dpakach
Copy link
Contributor Author

dpakach commented Jun 14, 2021

@pascalwengerter I cannot test this now because the EOS setup doesn't starts for me.
I get this error when starting EOS setup with the docker-compose file

ocis          | /root/go/pkg/mod/github.com/sciencemesh/[email protected]/meshdirectory_web.go:4:2: package embed is not in GOROOT (/usr/local/go/src/embed)
ocis          | /root/go/pkg/mod/github.com/sciencemesh/[email protected]/meshdirectory_web.go:5:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)
ocis          | make: *** [bin/ocis] Error 1
ocis          | /entrypoint: line 4: /ocis/bin/ocis: No such file or directory
ocis exited with code 127  

@butonic
Copy link
Member

butonic commented Mar 5, 2024

eos has still not become part of the product. closing for now

@butonic butonic closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants