eNMS-automation / eNMS

An enterprise-grade vendor-agnostic network automation platform.
https://www.enms.io/
GNU General Public License v3.0
814 stars 162 forks source link

unable to create workflow on default install (4.2.1 and 4.4.0) #394

Open mattpattie opened 1 year ago

mattpattie commented 1 year ago

I have tried to create a workflow and a top level workflow to version 4.2.1. I am always returning an alert of

Error 403: operation not allowed

I have tried on both a blank install and also an install with the examples no dice

On version 4.4 I am getting Error 403: Not Authorized on an instance with no example data. however if i use the example data it works as expected to create a new workflow

Any assistance would be greatly appreciated

Further update after doing some testing the [shared] start and [shared] end are not in the empty migration and these, i am guessing, are hardcoded in the work flow builder. without them it breaks the builder.

mattpattie commented 1 year ago

if you need an empty database. load the examples, you can then export the [shared]Start and [shared]End in the services page and then drop the db (or remove the sqlitedb) and then restart and import the tgz's. at which point you are good to go

mhill8304 commented 1 month ago

@mattpattie could you explain what you mean here? I've been working on resolving the same issue.

I'm not sure exactly how to load the examples, as you say.

I am also finding issues with uploading the backed up services I had in here, so that may be part of it.

SaneiSaya commented 1 month ago

Did you export the examples? If so you can import them under services instead of workflows. They should be in .tgz format

mhill8304 commented 1 month ago

I have no examples to export, following the instructions at the end of the main readme

Edit: I actually think I found the source of the issue on my end. Digging through the migration_import function in controller.py, and found yaml.CLoader is being called. Jogged my memory on an error that came up during testing yesterday, something like CLoader can not be found - did you mean Loader?

Digging a little further, it looks like ruamel should be importing yaml.CLoader, but it is not, based on the error.

Edit: And final update, looks like this was due to a version issue. From ruamel.yaml:

extras_require={ ':platform_python_implementation=="CPython" and python_version<"3.11"': ['ruamel.yaml.clib>=0.2.6'], # NOQA 'jinja2': ['ruamel.yaml.jinja2>=0.2'], 'docs': ['ryd'], }, classifiers=[ 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: Markup', 'Typing :: Typed', ],

I was running python3.12. After downgrading, I'm now launching with examples and everything looks to be working as expected.

SaneiSaya commented 1 month ago

There are some built in examples that should come with the default build. Do you have logs that you can post?

mhill8304 commented 1 month ago

@SaneiSaya Turns out I was running wrong version of python, which was causing issues with ruamel.yaml, so it wasn't importing anything. Resolved after downgrade. Now instructions above are making more sense.

SaneiSaya commented 1 month ago

Great! Sounds like you're on your way