Hello everyone I’m following this document and <h...
# troubleshooting
u
Hello everyone I’m following this document and https://meltano.com/blog/how-to-build-a-custom-extractor-with-meltano/ setting up my first meltano project and while running the below command, I’m getting the below error
Copy code
❯ meltano run tap-jsonplaceholder target-jsonl
A Meltano environment must be specified. Set the `default_environment` option in `meltano.yml`, or the `--environment` CLI option.
the below is my melano.yml
Copy code
version: 1
send_anonymous_usage_stats: true
project_id: "tap-jsonplaceholder"
plugins:
  extractors:
  - name: "tap-jsonplaceholder"
    namespace: "tap_jsonplaceholder"
    pip_url: -e .
    capabilities:
    - state
    - catalog
    - discover
    config:
      start_date: '2010-01-01T00:00:00Z'
    settings:
    # TODO: To configure using Meltano, declare settings and their types here:
    - name: username
    - name: password
      kind: password
    - name: start_date
      value: '2010-01-01T00:00:00Z'
  loaders:
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl
even I tried to update the melatano.yml like this still the error exists
Copy code
version: 1
send_anonymous_usage_stats: true
default_environment: prod
project_id: "tap-jsonplaceholder"
environments:
  - name: prod
    config:
      plugins:
        extractors:
        - name: "tap-jsonplaceholder"
          namespace: "tap_jsonplaceholder"
          pip_url: -e .
          capabilities: 
          - state
          - catalog
          - discover
          config:
            start_date: '2010-01-01T00:00:00Z'
          settings:
          # TODO: To configure using Meltano, declare settings and their types here:
          - name: username
          - name: password
            kind: password
          - name: start_date
            value: '2010-01-01T00:00:00Z'
        loaders:
        - name: target-jsonl
          variant: andyh1203
          pip_url: target-jsonl
any support appreciated
p
Hey @unais_t - What meltano version are you on? I know there was a fix for something similar to this that went out in the last release https://github.com/meltano/meltano/pull/6862 (cc @Will Da Silva (Arch) ). Could you try upgrading your meltano version?
w
@pat_nadolny
meltano run
always requires an environment. The updated
meltano.yml
looks fine to me. I'll see if I can reproduce this issue.
When I run this with Meltano 2.8.0 I get:
Copy code
$ meltano run tap-jsonplaceholder target-jsonl
2022-10-20T15:36:39.756696Z [info     ] Environment 'prod' is active
[...]
Which is as expected.
p
@unais_t you can also try running just the tap independently using invoke for now
@Will Da Silva (Arch) I was able to reproduce using the meltano.yml thats created by the cookiecutter template from the SDK repo. After I upgraded to the newest meltano version it went away. I got
Environment 'dev' was not found.
when trying to
meltano install
w
Ah, makes sense. Let's update that template. https://github.com/meltano/sdk/issues/1092
p
Thats what worked for me when I tried to fix it locally. I moved it to a PR
@unais_t if you add this to your meltano.yml it should work or upgrading to the newest release would work too!
Copy code
default_environment: dev
environments:
- name: dev
- name: staging
- name: prod
w
@pat_nadolny the confusing part is that @unais_t did update their
meltano.yml
to configure the default environment as
prod
, and then defined that environment.
p
my bad I missed that part. Very strange
u
thanks @pat_nadolny and all, this is solved by replacing meltano.yml like this
Copy code
version: 1
send_anonymous_usage_stats: true
project_id: "tap-jsonplaceholder"
default_environment: dev
environments:
  - name: dev
plugins:
  extractors:
  - name: "tap-jsonplaceholder"
    namespace: "tap_jsonplaceholder"
    pip_url: -e .
    capabilities:
    - state
    - catalog
    - discover
    config:
      start_date: '2010-01-01T00:00:00Z'
    settings:
    # TODO: To configure using Meltano, declare settings and their types here:
    - name: username
    - name: password
      kind: password
    - name: start_date
      value: '2010-01-01T00:00:00Z'
  loaders:
  - name: target-jsonl
    variant: andyh1203
    pip_url: target-jsonl