Link Sharing Setup Run Error

Hello guys…

I have ran linksharing setup it creates config file.

But when I run linksharing run it gives me error :

2023-03-17T10:50:53.579+0530    INFO    process/exec_conf.go:298        Configuration loaded    {"Location": "C:\\Users\\Malay102\\AppData\\Roaming\\Storj\\Linksharing\\config.yaml"}                                                          2023-03-17T10:50:53.580+0530    INFO    process/tracing.go:73   Anonymized tracing enabled                              2023-03-17T10:50:53.585+0530    DEBUG   tracing collector       monkit-jaeger@v0.0.0-20220915074555-d100d7589f41/udp.go:128     started                                                                                                         2023-03-17T10:50:53.586+0530    DEBUG   process/debug.go:37     debug server listening on 127.0.0.1:61194               2023-03-17T10:50:53.601+0530    DEBUG   process/metrics.go:98   Telemetry disabled                                      2023-03-17T10:50:53.637+0530    DEBUG   process/exec_conf.go:408        Unrecoverable error     {"error": "unable to create handler: html/template: pattern matches no files: `pkg\\linksharing\\web\\*.html`", "errorVerbose": "unable to create handler: html/template: pattern matches no files: `pkg\\linksharing\\web\\*.html`\n\tstorj.io/gateway-mt/pkg/linksharing.New:83\n\tmain.cmdRun:143\n\tstorj.io/private/process.cleanup.func1.4:377\n\tstorj.io/private/process.cleanup.func1:395\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:92\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.Exec:64\n\tmain.main:212\n\truntime.main:250"} 

Am I missing any setup or configuration?

Please help me with this…

@Alexey
@jeremy

The linksharing service is a part of Edge services. You need to have authservice and gateway-mt setup and running, now you need to run linksharing service too.
Without authservice and gateway-mt uplink will be unable to generate URLs for linksharing service.

1 Like

Hello @Alexey

Yes I have run authservice and gateway-mt both…

What next…?

1 Like

Hello @Alexey yes I have seen this one.

But why should getting this Error ?

You need to copy gateway-mt/pkg/linksharing/web at main · storj/gateway-mt · GitHub to the binary location (the path must be pkg/linksharing/web).

By the way, since it’s a local setup, you will need to use a custom name in the uplink CLI:

uplink share --url --base-url http://localhost:20020  --auth-service http://localhost:7772
1 Like

Hello @Alexey

Why should I copy because it is already there when I was doing setup for gateway-mt.

Is there anything specific reason for doing this again?

And one more thing my gatewa-mt run string is following:

Please suggest me updated uplink share string…

authservice run ^
   --allowed-satellites 1cHs6ANQpQUogapBLCL5Tzr57NWnT7kfwNuvgZNWkihVkEFxTQ@127.0.0.1:10000 ^
   --auth-token my-test-auth-token ^
   --endpoint http://localhost:8002 ^
   --listen-addr : 8000^
   --kv-backend badger://
   
 gateway-mt run ^
   --auth.token my-test-auth-token ^
   --auth.base-url http://localhost:8000 ^
   --domain-name localhost ^
   --server.address localhost:8002 ^
   --insecure-disable-tls

This is just depends on where your binary is running. This service expects files from gateway-mt/pkg/linksharing/web at main · storj/gateway-mt · GitHub to be in the directory where your linksharing binary is located as pkg/linksharing/web.
You may also just try to switch to the cloned repository before you run the linksharing service, but likely it want that directory in the binary location.

1 Like

Yes I do have that then what is the issue?

@Alexey

Okay @Alexey

Let describe this a little bit in detail so you can understand properly and able to help me with that.

My satellite is running on port 10002 my gateway-mt configuration I have stagged .

   --allowed-satellites 1cHs6ANQpQUogapBLCL5Tzr57NWnT7kfwNuvgZNWkihVkEFxTQ@127.0.0.1:10000 ^
   --auth-token my-test-auth-token ^
   --endpoint http://localhost:8002 ^
   --listen-addr : 8000^
   --kv-backend badger://
   
 gateway-mt run ^
   --auth.token my-test-auth-token ^
   --auth.base-url http://localhost:8000 ^
   --domain-name localhost ^
   --server.address localhost:8002 ^
   --insecure-disable-tls

I can now able to create bucket and upload objects also.

But what is happening now is when i preview any object in this case one image file it is keep loading.

Here I am attaching screenshot so you can refer that also

As per my knowledge this is happening because of linksharing is not cofigured properly…

It expecting that linksharing service is running on 8001 port, so you need to setup it like this:

linksharing setup --defaults dev --public-url http://localhost:8001 --cert-file="" --key-file="" --address=":20020" --auth-service.base-url http://localhost:7772

Then run

linksharing run

To see configuration options:

linksharing setup --help
1 Like

Still I am getting the same error at linksharing run .

What should I do?
@Alexey

Did you copy the required folder to the linksharing binary location?

Why should I copy again because when I installed GitHub - storj/gateway-mt: Storj edge services (including multi-tenant, S3 compatible server to interact with the Storj network) binary it already there at the location…

@Alexey

the path pkg/linksharing/web should exist in the binary location,
so the directory tree should look like

|- pkg
|    |- linksharing
|              |- web
|
|- linksharing

The path pkg/linksharing/web should contain everything from gateway-mt/pkg/linksharing/web at main · storj/gateway-mt · GitHub

You may do so either by copying of pkg folder to the linksharing binary location or by copying/moving linksharing binary to the root of the repository and run it from there.

1 Like

Hello @Alexey ,

Yes I do have same directory structure in present still getting this error.

2023-03-21T10:05:48.041+0530    INFO    process/exec_conf.go:298        Configuration loaded    {"Location": "C:\\Users\\Malay102\\AppData\\Roaming\\Storj\\Linksharing\\config.yaml"}                                                          2023-03-21T10:05:48.042+0530    INFO    process/tracing.go:73   Anonymized tracing enabled                              2023-03-21T10:05:48.047+0530    DEBUG   tracing collector       monkit-jaeger@v0.0.0-20220915074555-d100d7589f41/udp.go:128     started                                                                                                         2023-03-21T10:05:48.048+0530    DEBUG   process/debug.go:37     debug server listening on 127.0.0.1:57269               2023-03-21T10:05:48.048+0530    DEBUG   process/metrics.go:98   Telemetry disabled                                      2023-03-21T10:05:48.050+0530    DEBUG   process/exec_conf.go:408        Unrecoverable error     {"error": "unable to create handler: html/template: pattern matches no files: `pkg\\linksharing\\web\\*.html`", "errorVerbose": "unable to create handler: html/template: pattern matches no files: `pkg\\linksharing\\web\\*.html`\n\tstorj.io/gateway-mt/pkg/linksharing.New:83\n\tmain.cmdRun:143\n\tstorj.io/private/process.cleanup.func1.4:377\n\tstorj.io/private/process.cleanup.func1:395\n\tgithub.com/spf13/cobra.(*Command).execute:852\n\tgithub.com/spf13/cobra.(*Command).ExecuteC:960\n\tgithub.com/spf13/cobra.(*Command).Execute:897\n\tstorj.io/private/process.ExecWithCustomConfigAndLogger:92\n\tstorj.io/private/process.ExecWithCustomConfig:74\n\tstorj.io/private/process.Exec:64\n\tmain.main:212\n\truntime.main:250"} 

What should I do?

@Alexey @jeremy
My config.yaml of linksharing look like this

# public address to listen on
address: :20020

# public tls address to listen on
address-tls: :20021

# The active time between retries, typically not set
# auth-service.back-off.delay: 0s

# The maximum total time to allow retries
# auth-service.back-off.max: 5m0s

# The minimum time between retries
# auth-service.back-off.min: 100ms

# base url to use for resolving access key ids
auth-service.base-url: http://localhost:8000

# how many cached access grants to keep in cache
auth-service.cache.capacity: 10000

# how long to keep cached access grants in cache
auth-service.cache.expiration: 24h0m0s

# how long to wait for a single auth service connection
auth-service.timeout: 10s

# auth token for giving access to the auth service
auth-service.token: super-secret

# server certificate file
cert-file: ""

# bucket to use for certificate storage with optional prefix (bucket/prefix)
cert-magic.bucket: ""

# email address to use when creating an ACME account
cert-magic.email: ""

# use CertMagic to handle TLS certificates
cert-magic.enabled: false

# path to the service account key file
cert-magic.key-file: ""

# comma separated list of domain names which bypass paid tier queries. Set to * to disable tier check entirely
cert-magic.skip-paid-tier-allowlist: []

# use staging CA endpoints
cert-magic.staging: true

# tier querying service cache capacity
cert-magic.tier-cache-capacity: 10000

# expiration time for tier querying service cache
cert-magic.tier-cache-expiration: 10s

# path to the certificate chain for this identity
cert-magic.tier-service-identity.cert-path: \identity.cert

# path to the private key for this identity
cert-magic.tier-service-identity.key-path: \identity.key

# list of clients IPs (comma separated) which are trusted; usually used when the service run behinds gateways, load balancers, etc.
client-trusted-ips-list: []

# RPC connection pool capacity
connection-pool.capacity: 100

# RPC connection pool idle expiration
connection-pool.idle-expiration: 2m0s

# RPC connection pool key capacity
connection-pool.key-capacity: 5

# address to listen on for debug endpoints
# debug.addr: 127.0.0.1:0

# If set, a path to write a process trace SVG to
# debug.trace-out: ""

# timeout for dials
# dial-timeout: 10s

# dns server address to use for TXT resolution
dns-server: 1.1.1.1:53

# maxmind database file path
geo-location-db: ""

# listen using insecure connections only
insecure-disable-tls: true

# server key file
key-file: ""

# the url to redirect empty requests to
landing-redirect-target: https://www.storj.io/

# if true, log function filename and line number
# log.caller: true

# if true, set logging to development mode
# log.development: true

# configures log encoding. can either be 'console', 'json', 'pretty', or 'gcloudlogging'.
# log.encoding: ""

# the minimum log level to log
# log.level: debug

# can be stdout, stderr, or a filename
# log.output: stderr

# if true, log stack traces
# log.stack: true

# address(es) to send telemetry to (comma-separated)
# metrics.addr: ""

# application name for telemetry identification. Ignored for certain applications.
# metrics.app: linksharing

# application suffix. Ignored for certain applications.
# metrics.app-suffix: -dev

# address(es) to send telemetry to (comma-separated)
# metrics.event-addr: ""

# instance id prefix
# metrics.instance-prefix: ""

# how frequently to send up telemetry. Ignored for certain applications.
# metrics.interval: 1m0s

# comma separated list of public urls for the server
public-url: http://localhost:8001

# The default number of iterations for each check
# quickchecks: 100

# redirect to HTTPS
redirect-https: false

# time to delay server shutdown while returning 503s on the health endpoint
shutdown-delay: 1s

# enable standard (non-hosting) requests to render content and not only download it
standard-renders-content: false

# serve HTML as text/html instead of text/plain for standard (non-hosting) requests
standard-views-html: false

# the path to where web assets are located
static-sources-path: ./pkg/linksharing/web/static

# the path to where renderable templates are located
templates: ./pkg/linksharing/web

# address for jaeger agent
# tracing.agent-addr: 127.0.0.1:5775

# application name for tracing identification
# tracing.app: linksharing

# application suffix
# tracing.app-suffix: -dev

# buffer size for collector batch packet size
# tracing.buffer-size: 0

# whether tracing collector is enabled
# tracing.enabled: true

# how frequently to flush traces to tracing agent
# tracing.interval: 0s

# buffer size for collector queue size
# tracing.queue-size: 0

# how frequent to sample traces
# tracing.sample: 0

# max ttl (seconds) for website hosting txt record cache
txt-record-ttl: 10s

# use the headers sent by the client to identify its IP. When true the list of IPs set by --client-trusted-ips-list, when not empty, is used
use-client-ip-headers: true

After I run command setup for linksharing.

My directory sturucture is

D:\gateway-mt\pkg\linksharing\web

Where gateway-mt/pkg/linksharing/web at main · storj/gateway-mt · GitHub
all exist .

Am I missing something?

Please help me regarding this…

@Alexey @jeremy

Try to provide the absolute path to the web files

also, do you have *.html files there? And subfolder static with the all content?

1 Like

@Alexey

Yes I have content and *.html files also

And Yes, thanks the error has gone.

Let me try and check and if in satellite web all working fine or not.

1 Like