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

Error when using env FCL variable in the config block #207

Closed
traut opened this issue Jun 18, 2024 · 1 comment
Closed

Error when using env FCL variable in the config block #207

traut opened this issue Jun 18, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@traut
Copy link
Member

traut commented Jun 18, 2024

Description

Fabric throws an error when env is used in the config block.

Steps to Reproduce

The config block used in the template:

config data elasticsearch {
  cloud_id = env.ELASTIC_CLOUD_ID
  api_key_str = env.ELASTIC_API_KEY
}

Expected Behavior

The env var values are loaded either from the .env file or from the environment, and used as the argument values.

Actual Behavior

$ fabric data document.simple_alerts_overview.data.elasticsearch.alerts_last_week
Jun 18 13:19:00.086 INF Parsing fabric files command=data
Jun 18 13:19:00.095 INF Loading plugin resolver command=data includeRemote=false
Jun 18 13:19:00.096 INF Loading plugin runner command=data
Jun 18 13:19:00.121 INF Loading plugin command=data component=runner name=blackstork/elastic path=.fabric/plugins/blackstork/elastic@0.4.2-rc3
Jun 18 13:19:00.487 INF Loading plugin command=data component=runner name=blackstork/openai path=.fabric/plugins/blackstork/openai@0.4.2-rc3
Jun 18 13:19:00.687 INF Fetching data command=data target=document.simple_alerts_overview.data.elasticsearch.alerts_last_week
Jun 18 13:19:00.687 INF Loading document data command=data document=simple_alerts_overview datasource=elasticsearch name=alerts_last_week
Error: Variables not allowed

  on simple-overview.fabric line 10, in config "data" "elasticsearch":
  10:   cloud_id = env.ELASTIC_CLOUD_ID

Variables may not be used here.

Error: Variables not allowed

  on simple-overview.fabric line 11, in config "data" "elasticsearch":
  11:   api_key_str = env.ELASTIC_API_KEY

Variables may not be used here.

Additional Context

  • tested on v0.4.2-rc3
@traut traut added the bug Something isn't working label Jun 18, 2024
@traut traut changed the title Error when using env FCL variable in the template Error when using env FCL variable in the config block Jun 18, 2024
@traut traut added this to the v0.4 milestone Jun 18, 2024
@traut traut mentioned this issue Jun 18, 2024
@Andrew-Morozko
Copy link
Contributor

Fixed with #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants