Skip to content

Constraint on attribute error is not reported without -X #774

@bartv

Description

@bartv
Traceback (most recent call last):
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 648, in set_attribute
    self.slots[name].set_value(value, location, recur)
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 87, in set_value
    self.type.validate(value)
  File "/home/bart/workspace/inmanta/src/inmanta/ast/type.py", line 508, in validate
    raise RuntimeException(self, "Invalid value '%s', constraint does not match" % value)
inmanta.ast.RuntimeException: Invalid value '132324', constraint does not match (reported in unet::service_id_t (model/_init.cf:23:9))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bart/workspace/inmanta/src/inmanta/app.py", line 433, in app
    options.func(options)
  File "/home/bart/workspace/inmanta/src/inmanta/app.py", line 290, in export
    raise exp
  File "/home/bart/workspace/inmanta/src/inmanta/app.py", line 274, in export
    (types, scopes) = do_compile()
  File "/home/bart/workspace/inmanta/src/inmanta/compiler.py", line 45, in do_compile
    success = sched.run(compiler, statements, blocks)
  File "/home/bart/workspace/inmanta/src/inmanta/execute/scheduler.py", line 246, in run
    next.execute()
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 480, in execute
    raise e
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 477, in execute
    self._unsafe_execute()
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 471, in _unsafe_execute
    value = self.expression.execute(requires, self.resolver, self.queue_scheduler)
  File "/home/bart/workspace/inmanta/src/inmanta/ast/statements/generator.py", line 298, in execute
    object_instance = type_class.get_instance(attributes, resolver, queue, self.location)
  File "/home/bart/workspace/inmanta/src/inmanta/ast/entity.py", line 324, in get_instance
    out.set_attribute(k, v, location)
  File "/home/bart/workspace/inmanta/src/inmanta/execute/runtime.py", line 650, in set_attribute
    raise AttributeException(self, self, name, cause=e)
inmanta.ast.AttributeException: Could not set attribute `service_id` on instance `xxx::ELan (instantiated at model/api.cf:25)` (reported in Construct(xxx::ELan) (model/api.cf:25))

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions