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

field embedded_cache not found in type cache.Config #6915

Closed
mostafa opened this issue Aug 15, 2022 · 19 comments · Fixed by #7346
Closed

field embedded_cache not found in type cache.Config #6915

mostafa opened this issue Aug 15, 2022 · 19 comments · Fixed by #7346
Assignees
Labels
type/bug Somehing is not working as expected type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories

Comments

@mostafa
Copy link
Member

mostafa commented Aug 15, 2022

Describe the bug
After trying the instructions on installing and running Loki locally on a Linux instance, I got this error:

$ ./loki-linux-amd64 -config.file=loki-local-config.yaml
failed parsing config: loki-local-config.yaml: yaml: unmarshal errors:
  line 22: field embedded_cache not found in type cache.Config

Commenting out the embedded_cache helps it run normally.

To Reproduce
Steps to reproduce the behavior:

  1. Download and unzip Loki v2.6.1 from the GitHub release page:
    $ curl -O -L "https://github.com/grafana/loki/releases/download/v2.6.1/loki-linux-amd64.zip"
    # extract the binary
    $ unzip "loki-linux-amd64.zip"
    # make sure it is executable
    $ chmod a+x "loki-linux-amd64"
  2. Download the latest config for running Loki locally:
    wget https://raw.githubusercontent.com/grafana/loki/master/cmd/loki/loki-local-config.yaml
  3. Run it:
    ./loki-linux-amd64 -config.file=loki-local-config.yaml
  4. See the error:
    failed parsing config: loki-local-config.yaml: yaml: unmarshal errors:
      line 22: field embedded_cache not found in type cache.Config

Expected behavior
It should run normally, I suppose.

Environment:

  • Infrastructure: laptop
  • Deployment tool: None. (ran locally)

Screenshots, Promtail config, or terminal output
If applicable, add any output to help explain your problem.

@Unostot
Copy link

Unostot commented Aug 15, 2022

just did the same thing and got stuck there...
searched and was suprised that someone had the same problem minutes before me

Please explain what changed so that the "getting started" makes the start with loki so discouraging ;)

@mostafa
Copy link
Member Author

mostafa commented Aug 15, 2022

@Unostot I'm sure it can be sorted out. I haven't found time to solve it myself though. 😅

@kavirajk kavirajk self-assigned this Aug 15, 2022
@kavirajk
Copy link
Collaborator

Thanks for reporting this issue :)

The problem is with the doc, it basically make you to run stable released version of Loki binary (in this case v2.6.1), with config file from latest tip of the main branch (unstable, which actually contains fifocache config)

The config loki-local-config.yaml should also also from v2.6.1 branch/tag instead.

Feel free to create PR for the doc fix (or I will fix it tmrw)

@kavirajk kavirajk added kind/bug type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories labels Aug 15, 2022
@neelabalan
Copy link

@mostafa try using this - it works for me on v2.6.0

auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096

common:
  path_prefix: /tmp/loki
  storage:
    filesystem:
      chunks_directory: /tmp/loki/chunks
      rules_directory: /tmp/loki/rules
  replication_factor: 1
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: inmemory

schema_config:
  configs:
    - from: 2020-10-24
      store: boltdb-shipper
      object_store: filesystem
      schema: v11
      index:
        prefix: index_
        period: 24h

ruler:
  alertmanager_url: http://localhost:9093

@rgrullon
Copy link

rgrullon commented Oct 5, 2022

This issue is still present in the docs

@mostafa
Copy link
Member Author

mostafa commented Oct 5, 2022

I'll fix this.

@mostafa mostafa self-assigned this Oct 5, 2022
owen-d pushed a commit that referenced this issue Oct 5, 2022
**What this PR does / why we need it**:
The config file URL mentioned in the docs contain config options that
doesn't match the latest version of Loki, which, as of now, is v2.6.1.

**Which issue(s) this PR fixes**:
Fixes #6915 

**Special notes for your reviewer**:
Disclaimer: I am a Grafanista from k6.

**Checklist**
- [x] Reviewed the `CONTRIBUTING.md` guide
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
@billq
Copy link

billq commented Oct 20, 2022

Still (or again?) broken. Same error following the same directions.

@mostafa
Copy link
Member Author

mostafa commented Oct 20, 2022

@billq
It is updated on the main branch, which means it is available on the next, but not latest v2.6.x.

@Corfucinas
Copy link

Alright, time to wait for merge, just ran into the same problem

@mostafa
Copy link
Member Author

mostafa commented Oct 24, 2022

@Corfucinas You can safely use the correct URL as I noted in the PR #7346:

Note: Use the corresponding Git refs that match your downloaded Loki version to get the correct configuration file. For example, if you are using Loki version 2.6.1, you need to use the https://raw.githubusercontent.com/grafana/loki/v2.6.1/cmd/loki/loki-local-config.yaml URL to download the configuration file that corresponds to the Loki version you aim to run.

@Corfucinas
Copy link

Hey there @mostafa

Is there's a way to add

query_range:
  results_cache:
    cache:
      embedded_cache:
        enabled: true
        distributed: false
        max_size_mb: 100

@mostafa
Copy link
Member Author

mostafa commented Oct 25, 2022

@Corfucinas I suppose not, because the tag is already on a specific commit, and I don't think we can do anything about it until the next release.
@owen-d Please correct me if I am wrong regarding my answer above. 👆

@Corfucinas
Copy link

Hey @mostafa

Sorry, I think my comment was not sufficiently clear. I meant "Is there a way to add"... query_range within the current release? Or it will be possible to use it once -as you mention- the next release?

If the latter, I can just comment it out and enable it in the future, thanks!

@mostafa
Copy link
Member Author

mostafa commented Oct 31, 2022

@Corfucinas A Loki developer like @owen-d would be a better person to answer this.

lxwzy pushed a commit to lxwzy/loki that referenced this issue Nov 7, 2022
…7346)

**What this PR does / why we need it**:
The config file URL mentioned in the docs contain config options that
doesn't match the latest version of Loki, which, as of now, is v2.6.1.

**Which issue(s) this PR fixes**:
Fixes grafana#6915 

**Special notes for your reviewer**:
Disclaimer: I am a Grafanista from k6.

**Checklist**
- [x] Reviewed the `CONTRIBUTING.md` guide
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
changhyuni pushed a commit to changhyuni/loki that referenced this issue Nov 8, 2022
…7346)

**What this PR does / why we need it**:
The config file URL mentioned in the docs contain config options that
doesn't match the latest version of Loki, which, as of now, is v2.6.1.

**Which issue(s) this PR fixes**:
Fixes grafana#6915 

**Special notes for your reviewer**:
Disclaimer: I am a Grafanista from k6.

**Checklist**
- [x] Reviewed the `CONTRIBUTING.md` guide
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
Abuelodelanada pushed a commit to canonical/loki that referenced this issue Dec 1, 2022
…7346)

**What this PR does / why we need it**:
The config file URL mentioned in the docs contain config options that
doesn't match the latest version of Loki, which, as of now, is v2.6.1.

**Which issue(s) this PR fixes**:
Fixes grafana#6915 

**Special notes for your reviewer**:
Disclaimer: I am a Grafanista from k6.

**Checklist**
- [x] Reviewed the `CONTRIBUTING.md` guide
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/upgrading/_index.md`
@yongzhang
Copy link

same issue, can't figure it out (v2.7.1):

failed parsing config: config.yaml: yaml: unmarshal errors:
  line 33: field embedded-cache not found in type cache.Config

config:

query_range:
  align_queries_with_step: true
  results_cache:
    cache:
      embedded-cache:
        enabled: true
        max_size_mb: 4096
        ttl: 24h
  cache_results: true

@yongzhang
Copy link

same issue, can't figure it out (v2.7.1):

failed parsing config: config.yaml: yaml: unmarshal errors:
  line 33: field embedded-cache not found in type cache.Config

config:

query_range:
  align_queries_with_step: true
  results_cache:
    cache:
      embedded-cache:
        enabled: true
        max_size_mb: 4096
        ttl: 24h
  cache_results: true

ok, I spent hours to find out there was a typo in the doc, it should be underscore not hyphen....

image

@Corfucinas
Copy link

same issue, can't figure it out (v2.7.1):

failed parsing config: config.yaml: yaml: unmarshal errors:
  line 33: field embedded-cache not found in type cache.Config

config:

query_range:
  align_queries_with_step: true
  results_cache:
    cache:
      embedded-cache:
        enabled: true
        max_size_mb: 4096
        ttl: 24h
  cache_results: true

ok, I spent hours to find out there was a typo in the doc, it should be underscore not hyphen....

image

Thanks for this

@salarali
Copy link

salarali commented Feb 3, 2023

This issue is still there. I spent some time figuring this out.

@mostafa
Copy link
Member Author

mostafa commented Feb 6, 2023

@kavirajk

Can the changes be backported to the docs in v2.6.x?

@chaudum chaudum added the type/bug Somehing is not working as expected label Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Somehing is not working as expected type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants