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

K2 Detailed Config Error #523

Open
subbyte opened this issue Jun 6, 2024 · 1 comment · Fixed by #524
Open

K2 Detailed Config Error #523

subbyte opened this issue Jun 6, 2024 · 1 comment · Fixed by #524
Labels
enhancement New feature or request

Comments

@subbyte
Copy link
Member

subbyte commented Jun 6, 2024

Need more detailed guards in interface config loading to test against config problems and raise exception to the user with details (so the user will understand how to fix). @pcoccoli suggested to use a single Exception type, fed with different details as payload.

One idea to help dev: try introducing an error and seeing what happens.

@subbyte subbyte added the enhancement New feature or request label Jun 6, 2024
@pcoccoli
Copy link
Collaborator

pcoccoli commented Jul 11, 2024

This is all I see now:

k2 (develop) ~/github/kestrel-lang$ kestrel sds_syslog_sysmon_test.hf 
Traceback (most recent call last):
  File "/home/pcoccoli/.pyenv/versions/k2/bin/kestrel", line 8, in <module>
    sys.exit(kestrel())
  File "/home/pcoccoli/github/kestrel-lang/packages/kestrel_core/src/kestrel/cli.py", line 49, in kestrel
    outputs = session.execute(huntflow)
  File "/home/pcoccoli/github/kestrel-lang/packages/kestrel_core/src/kestrel/session.py", line 53, in execute
    return list(self.execute_to_generate(huntflow_block))
  File "/home/pcoccoli/github/kestrel-lang/packages/kestrel_core/src/kestrel/session.py", line 77, in execute_to_generate
    yield self.evaluate_instruction(ret)
  File "/home/pcoccoli/github/kestrel-lang/packages/kestrel_core/src/kestrel/session.py", line 108, in evaluate_instruction
    interface = _interface_manager[g.interface]
  File "/home/pcoccoli/github/kestrel-lang/packages/kestrel_core/src/kestrel/interface/manager.py", line 45, in __getitem__
    raise InterfaceNotFound(f"no interface loaded for scheme {scheme}")

There's no clue here for the user about what is misconfigured. The actual problem is that I haven't set table_creation_permission in my sqlalchemy.yaml.

Enabling debug, the only relevant log lines are:

11:04:42 DEBUG kestrel_interface_sqlalchemy.interface SQLAlchemyInterface: loading config
11:04:42 DEBUG kestrel.config.utils User configuration file found: /home/pcoccoli/.config/kestrel/sqlalchemy.yaml
11:04:42 DEBUG kestrel.interface.manager Interface SQLAlchemyInterface not configured; ignored

This is very misleading.

@pcoccoli pcoccoli reopened this Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants