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

"ignoring DynamoDB URL path" #310

Closed
setevoy2 opened this issue Feb 11, 2019 · 13 comments
Closed

"ignoring DynamoDB URL path" #310

setevoy2 opened this issue Feb 11, 2019 · 13 comments
Labels
stale A stale issue or PR that will automatically be closed.

Comments

@setevoy2
Copy link

Hi.
I'm trying to configure an S3 bucket and DynamoDB's table to be used from Loki using two examples - here and here.

The first one says:

schema_config:
  configs:
  - from: 0
    store: aws
    object_store: aws
    schema: v9
    index:
      prefix: dynamodb_table_name
      period: 0

And the second one is:

  configs:
  - from: 0
    store: dynamo
    object_store: s3
    schema: v9
    index:
      prefix: dynamodb_table_name
      period: 0

But using both examples - I'm getting the error:

loki_1 | level=warn ts=2019-02-11T13:25:05.401742684Z caller=factory.go:133 msg="ignoring DynamoDB URL path" path=W8/+CWFN@eu-west-1
loki_1 | level=warn ts=2019-02-11T13:25:05.401758262Z caller=dynamodb_storage_client.go:833 msg="ignoring DynamoDB URL path" path=W8/+C
WFN@eu-west-1

Then once any request made from Grafana - Loki going down with another error:

loki_1 | panic: runtime error: invalid memory address or nil pointer dereference
loki_1 | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe5809e]
loki_1 |
loki_1 | goroutine 171 [running]:
loki_1 | github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws.dynamoDBRequestAdapter.Retryable(0xc0000a8000, 0x12822fa)
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws/dynamodb_storage_client.go:457 +0xe
loki_1 | github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws.dynamoDBStorageClient.queryPage(0xc00009ae00, 0x4000000000000000, 0x0, 0x0, 0x0, 0x186a0, 0x3ff4cccccccccccd, 0x12b1ab6, 0x51, 0x12b3d66, ...)
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws/dynamodb_storage_client.go:380 +0x3b3
loki_1 | github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws.dynamoDBStorageClient.query(0xc00009ae00, 0x4000000000000000, 0x0, 0x0, 0x0, 0x186a0, 0x3ff4cccccccccccd, 0x12b1ab6, 0x51, 0x12b3d66, ...)
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws/dynamodb_storage_client.go:337 +0x44a
loki_1 | github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws.dynamoDBStorageClient.query-fm(0x1401d00, 0xc0007576b0, 0xc0003f4a80, 0x8, 0xc000444b80, 0x14, 0x0, 0x0, 0x0, 0x0, ...)
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/aws/dynamodb_storage_client.go:285 +0xb4
loki_1 | github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/util.DoParallelQueries.func1(0x1401d00, 0xc000757500, 0xc00075a240, 0xc00075a2a0, 0xc000132400, 0xc0002abba0)
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/util/util.go:42 +0x111
loki_1 | created by github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/util.DoParallelQueries
loki_1 | /go/src/github.com/grafana/loki/vendor/github.com/cortexproject/cortex/pkg/chunk/util/util.go:34 +0xf4
admin_loki_1 exited with code 2

Can't understand this message:

msg="ignoring DynamoDB URL path" path=W8/+C***WFN@eu-west-1

Why it's starting from the "W8/+" if inside config it looks like:

...
schema_config:
  configs:
  - from: 0
    store: dynamo
    object_store: s3
    schema: v9
    index:
      prefix: loki-poc
      period: 0

storage_config:
#  boltdb:
#    directory: /tmp/loki/index

#  filesystem:
#    directory: /tmp/loki/chunks
  aws:
     s3: s3://AKI***PHA:0/W8/+***WFN@eu-west-1/logger-loki-poc
     dynamodbconfig:
       dynamodb: "dynamodb://AKI***PHA:0/W8/+***WFN@eu-west-1"

The SECRET_KEY is stating from the "0/W8/+" symbols - not "W8/+C" - where the "0/" symbol missed? Mybe a bug with "0/"? Or just my wrong configuration?

DymanoDB table "loki-poc" was created manually, with the OrgID as a primary key filed (not sure this is correct).

Trying to add the quotes around it - but didn't help.

@setevoy2
Copy link
Author

Yes, the issue above caused by the "0/" and "/" symbols in the SECRET_KEY.
Generated new key without "/" - now it "works" but with another error which is obviously caused by my DynamoDB table's config:

loki_1 | level=error ts=2019-02-11T14:08:35.322757196Z caller=chunk_store.go:391 org_id=fake msg="error querying storage" err="QueryPage error: table=loki-poc, err=ValidationException: Query condition missed key schema element: OrgID\n\tstatus code: 400, request id: 7INPECMU"

@yubozhao
Copy link
Contributor

Hi @setevoy2 Please refer documents from the master branch with the latest commit. So use operations.md as the reference. The secret_key bug you can file it at github.com/weaveswork/common. That's the upstream package that handles this.

@setevoy2
Copy link
Author

Thanks, @yubozhao!

Indeed - there are keys mentioned (now?) in the operations.md:

primary index key to h (string) and use r (binary) as the sort key
Now it works.

Not sure about the 0/ bug (from the http://github.com/weaveworks/common) but anyway it works with new keys, so it's OK for now.

@base698
Copy link
Contributor

base698 commented Apr 28, 2019

I'm getting level=error ts=2019-04-28T17:01:44.281886806Z caller=client.go:186 msg="final error sending batch" status=401 error="server returned HTTP status 401 Unauthorized (401): no org id" in promtail. Is this from Loki or Dynamodb?

@yubozhao
Copy link
Contributor

@base698
I haven't touch Loki for a while, so my information might be outdated. So my last understandinf of Loki is Loki does have basic multi-tenant support, but I don't think it is documented yet. If you look closely in their production deployment example, it has a nginx sits in front of Loki and attaches a new X-Scope-OrgID header in the incoming requests.

You can do the same thing as Loki's team with another layer in front of Loki and mutate the incoming requests with the new header.

@yubozhao
Copy link
Contributor

yubozhao commented Apr 28, 2019

You can also do auth_enabled: false in the Loki's configuration setting.

This is where they talked about it https://github.com/grafana/loki/blob/d33722dc71559a1cfd150eb4926b073537ce4c5c/docs/operations.md#authentication

@base698
Copy link
Contributor

base698 commented Apr 28, 2019 via email

@yubozhao
Copy link
Contributor

Hmm interesting. I have ours running on k8s/aws with dynamodb/s3. I don’t think I did anything different. Maybe an older version? Keep me posted with your progress. Want to learn

@base698
Copy link
Contributor

base698 commented Apr 28, 2019 via email

@base698
Copy link
Contributor

base698 commented Apr 28, 2019

In this file: https://github.com/grafana/loki/blob/master/pkg/promtail/targets/filetargetmanager.go#L171

Adding:

			labels = labels.Merge(model.LabelSet{"__name__": model.LabelValue("somename")})

Fixes it. I see the logs now in loki

@yubozhao
Copy link
Contributor

Cool glad you figured it out. Enjoy your Sunday!

@stale
Copy link

stale bot commented Sep 3, 2019

This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Sep 3, 2019
@stale stale bot closed this as completed Sep 10, 2019
@Sreevani871
Copy link

auth_enabled: false results in a 400 error "sample missing metric name" which is in the code here: https://github.com/grafana/loki/blob/master/vendor/github.com/cortexproject/cortex/pkg/util/validation/validate.go#L16 It works locally with a config that doesn't have the AWS stuff in it. 🤷

On Sun, Apr 28, 2019 at 11:38 AM Bozhao @.***> wrote: You can also do auth_enabled: false in the Loki's configuration setting. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#310 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AABSVGXEQXAZ3G5LHKATB5DPSXVLZANCNFSM4GWQ4SLQ .

In this file: https://github.com/grafana/loki/blob/master/pkg/promtail/targets/filetargetmanager.go#L171

Adding:

			labels = labels.Merge(model.LabelSet{"__name__": model.LabelValue("somename")})

Fixes it. I see the logs now in loki

Facing the same issue. I didn't understand where to add this line of code labels = labels.Merge(model.LabelSet{"__name__": model.LabelValue("somename")}) exactly. https://github.com/grafana/loki/blob/master/pkg/promtail/targets/filetargetmanager.go#L171 does not have any labels variable.

periklis added a commit to periklis/loki that referenced this issue Sep 10, 2024
Update from upstream repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale A stale issue or PR that will automatically be closed.
Projects
None yet
Development

No branches or pull requests

4 participants