Giter VIP home page Giter VIP logo

zou's Introduction

Kitsu Logo

Zou, the Kitsu API is the memory of your animation production

The Kitsu API allows to store and manage the data of your animation/VFX production. Through it, you can link all the tools of your pipeline and make sure they are all synchronized.

A dedicated Python client, Gazu, allows users to integrate Zou into the tools.

CI badge Downloads badge Discord badge

Features

Zou can:

  • Store production data, such as projects, shots, assets, tasks, and file metadata.
  • Track the progress of your artists
  • Store preview files and version them
  • Provide folder and file paths for any task
  • Import and Export data to CSV files
  • Publish an event stream of changes

Installation and Documentation

Installation of Zou requires the setup of third-party tools such as a database instance, so it is recommended to follow the documentation:

https://zou.cg-wire.com/

Specification: - https://api-docs.kitsu.cloud/

Contributing

Contributions are welcomed so long as the C4 contract is respected.

Zou is based on Python and the Flask framework.

You can use the pre-commit hook for Black (a Python code formatter) before committing:

pip install pre-commit
pre-commit install

Instructions for setting up a development environment are available in the documentation

Contributors

  • @aboellinger (Xilam/Spa)
  • @BigRoy (Colorbleed)
  • @EvanBldy (CGWire) - maintainer
  • @ex5 (Blender Studio)
  • @flablog (Les Fées Spéciales)
  • @frankrousseau (CGWire) - maintainer
  • @kaamaurice (Tchak)
  • @g-Lul (TNZPV)
  • @pilou (Freelancer)
  • @LedruRollin (Cube-Xilam)
  • @mathbou (Zag)
  • @manuelrais (TNZPV)
  • @NehmatH (CGWire)
  • @pcharmoille (Unit Image)
  • @Tilix4 (Normaal)

About authors

Kitsu is written by CGWire, a company based in France. We help with animation and VFX studios to collaborate better through efficient tooling. We already work with more than 70 studios around the world.

Visit cg-wire.com for more information.

CGWire Logo

zou's People

Contributors

aboellinger avatar bigroy avatar cbsrobot avatar coraliegold avatar cs-student101 avatar evanbldy avatar ex5 avatar fabiansantiago avatar flablog avatar frankrousseau avatar hasusuf avatar imhotep93 avatar jhoolmans avatar kaamaurice avatar level-antoine avatar manuelrais avatar mathbou avatar maxdudik avatar mdk-man avatar nehmath avatar nicopennec avatar ninglesby avatar nledez avatar pcharmoille avatar pilou- avatar plyrolith avatar robin-vagner avatar scottmcdonnell avatar tilix4 avatar tokejepsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zou's Issues

Error uploading preview with comment

Ubuntu 18.04

/opt/zou/logs/gunicorn_error.log:

[2019-12-23 20:55:23 +0100] [21422] [INFO] Using worker: gevent
[2019-12-23 20:55:23 +0100] [21427] [INFO] Booting worker with pid: 21427
[2019-12-23 20:55:23 +0100] [21428] [INFO] Booting worker with pid: 21428
[2019-12-23 20:55:23 +0100] [21429] [INFO] Booting worker with pid: 21429
[2019-12-23 20:56:06,010] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/pictures/thumbnails/050/8db/0508db88-9971-4160-8718-90454140de57'
[2019-12-23 20:56:06,112] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/pictures/thumbnails/050/8db/0508db88-9971-4160-8718-90454140de57'
[2019-12-23 20:56:06,766] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/pictures/thumbnails/050/8db/0508db88-9971-4160-8718-90454140de57'
[2019-12-23 20:56:08,641] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/pictures/previews/0f8/99e/0f899ec0-40d3-460a-b4eb-47f715e5d69f'
[2019-12-23 20:56:08,652] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/movies/previews/0f8/99e/0f899ec0-40d3-460a-b4eb-47f715e5d69f'
[2019-12-23 20:56:08,739] ERROR in resources: [Errno 2] No such file or directory: '/opt/zou/previews/pictures/previews/0f8/99e/0f899ec0-40d3-460a-b4eb-47f715e5d69f'
[2019-12-23 20:56:19,082] ERROR in __init__: Traceback (most recent call last):
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_restful/__init__.py", line 458, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_jwt_extended/view_decorators.py", line 103, in wrapper
    return fn(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/blueprints/previews/resources.py", line 185, in post
    self.save_picture_preview(instance_id, uploaded_file)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/blueprints/previews/resources.py", line 234, in save_picture_preview
    tmp_folder, instance_id, uploaded_file
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/utils/thumbnail.py", line 23, in save_file
    file_to_save.save(file_path)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/werkzeug/datastructures.py", line 2799, in save
    dst = open(dst, "wb")
PermissionError: [Errno 13] Permission denied: '/tmp/zou/203c3e40-5665-4b01-aea6-6676f59176ad.jpg'

AttributeError: 'Person' object has no attribute 'serialize_without_info'`

from log:
ubuntu@ip-host:~$ tail -f /opt/zou/logs/gunicorn_error.log File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 573, in dispatch_request resp = meth(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_jwt_extended/view_decorators.py", line 103, in wrapper return fn(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/crud/base.py", line 246, in get result = self.serialize_instance(instance) File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/crud/person.py", line 67, in serialize_instance return instance.serialize_without_info() AttributeError: 'Person' object has no attribute 'serialize_without_info'

{"api": "Zou", "version": "0.11.50"}

Kitsu Not coming online

Kitsu goes down after a system reboot and does not come online. I have started zou, zou-events, redis, nignx, postgresql. I am using Ubuntu 18.04 LTS
I get an error message as Kitsu encountered an error while reaching its data API.

Kindly help

CMYK images are not supported

Issue:

The 'Attach Preview' function of Kitsu raise an error with cmyk images, but it seems to be a processing error within zou.

Traceback:
[2019-06-13 13:33:31,062] ERROR in __init__: Traceback (most recent call last):,
  File "/usr/local/lib/python3.7/site-packages/PIL/PngImagePlugin.py", line 706, in _save,
    rawmode, mode = _OUTMODES[mode],
KeyError: 'CMYK',
,
During handling of the above exception, another exception occurred:,
,
Traceback (most recent call last):,
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1612, in full_dispatch_request,
    rv = self.dispatch_request(),
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1598, in dispatch_request,
    return self.view_functions[rule.endpoint](**req.view_args),
  File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 477, in wrapper,
    resp = resource(*args, **kwargs),
  File "/usr/local/lib/python3.7/site-packages/flask/views.py", line 84, in view,
    return self.dispatch_request(*args, **kwargs),
  File "/usr/local/lib/python3.7/site-packages/flask_restful/__init__.py", line 587, in dispatch_request,
    resp = meth(*args, **kwargs),
  File "/usr/local/lib/python3.7/site-packages/flask_jwt_extended/view_decorators.py", line 38, in wrapper,
    return fn(*args, **kwargs),
  File "/usr/local/lib/python3.7/site-packages/zou/app/blueprints/previews/resources.py", line 162, in post,
    self.save_picture_preview(instance_id, uploaded_file),
  File "/usr/local/lib/python3.7/site-packages/zou/app/blueprints/previews/resources.py", line 220, in save_picture_preview,
    return self.save_variants(original_tmp_path, instance_id),
  File "/usr/local/lib/python3.7/site-packages/zou/app/blueprints/previews/resources.py", line 292, in save_variants,
    instance_id,
  File "/usr/local/lib/python3.7/site-packages/zou/app/utils/thumbnail.py", line 140, in generate_preview_variants,
    turn_into_thumbnail(picture_path, size),
  File "/usr/local/lib/python3.7/site-packages/zou/app/utils/thumbnail.py", line 76, in turn_into_thumbnail,
    im.save(file_path, "PNG"),
  File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 1728, in save,
    save_handler(self, fp, filename),
  File "/usr/local/lib/python3.7/site-packages/PIL/PngImagePlugin.py", line 708, in _save,
    raise IOError("cannot write mode %s as PNG" % mode),
OSError: cannot write mode CMYK as PNG,

having error when setup ZOU!!

hi, I have an issue when Prepare database!! im using ubuntu to do the zou setup.
here is the error

(zouenv) root@splinux:/opt/zou# DB_PASSWORD=password zou init_db
Creating database and tables...
Traceback (most recent call last):
  File "/opt/zou/zouenv/bin/zou", line 11, in <module>
    sys.exit(cli())
  File "/opt/zou/zouenv/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/zou/zouenv/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/cli.py", line 30, in init_db
    flask_migrate.upgrade(directory=directory)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_migrate/__init__.py", line 95, in wrapped
    f(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_migrate/__init__.py", line 280, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/alembic/command.py", line 254, in upgrade
    script.run_env()
  File "/opt/zou/zouenv/lib/python3.6/site-packages/alembic/script/base.py", line 427, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/opt/zou/zouenv/lib/python3.6/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/alembic/util/compat.py", line 82, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/migrations/env.py", line 106, in <module>
    run_migrations_online()
  File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/migrations/env.py", line 75, in run_migrations_online
    poolclass=pool.NullPool)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 460, in engine_from_config
    return create_engine(url, **options)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 419, in create_engine
    return strategy.create(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 80, in create
    dbapi = dialect_cls.dbapi(**dbapi_args)
  File "/opt/zou/zouenv/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 584, in dbapi
    import psycopg2
  File "/opt/zou/zouenv/lib/python3.6/site-packages/psycopg2/__init__.py", line 50, in <module>
    from psycopg2._psycopg import (                     # noqa
ImportError: /opt/zou/zouenv/lib/python3.6/site-packages/psycopg2/.libs/libresolv-2-c4c53def.5.so: symbol __res_maybe_init version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

hope you can help
Desmond

create_admin error code

Problem

Calling zou create_admin and handing it an invalid password returns error code 0, which makes it tricky to chain commands.

Scenario 1

$ zou create_admin && echo Success || echo Failure
Please enter an email for the new admin to create.
Email: [email protected]
Please enter a password for the new admin to create.
Password: pass
Password confirmation: pass
Passwords is too short.
Success

Scenario 2

$ zou create_admin && echo Success || echo Failure
Please enter an email for the new admin to create.
Email: [email protected]
Please enter a password for the new admin to create.
Password: password1
Password confirmation: password2
Passwords don't match.
Success

zou fails to start after upgrading to 0.9.33

Hi,

I just upgraded to zou 0.9.33 from 0.9.24 and zou now fails to start with the following in the error log, also trying to run the db upgrade command has a similar error.

I updated using pip as per the docs.

Error log output:
Traceback (most recent call last):
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 203, in init_process
    super(GeventWorker, self).init_process()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/opt/zou/zouenv/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/__init__.py", line 119, in <module>
    load_api()
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/__init__.py", line 114, in load_api
    from . import api
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/api.py", line 17, in <module>
    from .blueprints.playlists import blueprint as playlists_blueprint
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/blueprints/playlists/__init__.py", line 4, in <module>
    from .resources import (
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/blueprints/playlists/resources.py", line 19, in <module>
    from zou.app.stores import queue_store
  File "/opt/zou/zouenv/lib/python3.7/site-packages/zou/app/stores/queue_store.py", line 4, in <module>
    from rq import Queue
  File "/opt/zou/zouenv/lib/python3.7/site-packages/rq/__init__.py", line 9, in <module>
    from .queue import get_failed_queue, Queue
  File "/opt/zou/zouenv/lib/python3.7/site-packages/rq/queue.py", line 61
    async=True, job_class=None):
        ^
SyntaxError: invalid syntax
A very big guess as to the problem Based on my limited python ability, it appears to be pointing at async=True there at the end, I believe async is now a [reserved keyword in python 3.7](https://docs.python.org/3.7/whatsnew/3.7.html?highlight=reserved%20keywords).

Looking at the pip upgrade output, rq package is required to be 0.10.0, and a quick look in the rq pip release history shows that it doesn't support python 3.7 till 0.12.0 released in July last year.

Although having said that, everything was working fine in 0.9.24 and 0.9.21 before it, so I'm not sure if any of this is correct.

Running:
on Fedora 29
with Python 3.7.2

Thanks

Password reset email is not being sent

When I enter an email for password reset in the Kitsu interface I see the following in the logs:

Gunicorn

PUT //auth/reset-password HTTP/1.0" 200 18 "https://{site url}/reset-change-password/{uuid}

Nginx

POST //auth/reset-password HTTP/1.0" 200 32 "https://{site url}/reset-password"

Also I see the information about in the kitsu UI
image

I conclude that the request for password reset email is made but the system doesn't react to it in any way.

{
name: "Zou",
version: "0.12.9",
database-up: true,
key-value-store-up: true,
event-stream-up: true
}

image

Is the email supposed to be sent?

P.S. The invitations with the default passwords for new users are being sent out and delivered just fine.

ValueError: signal only works in main thread

When getting zou up and running for the first time with the command (as mentioned in the docs)

FLASK_DEBUG=1 FLASK_APP=zou.app flask run

I get a ValueError: signal only works in main thread error when visiting localhost:5000.

A quick search mentions an issue with Flask-SocketIO, but I'm not sure this is the cause or if the issue is due to some misconfiguration on my end. Any advice?

timeout de l'event stream

  • rappel: rajouter events à la fin de proxy_pass pour la section location /events dans conf.d/zou.conf:
    proxy_pass: http://localhost:5001/events
    (il y avait une erreur dans la doc la dernière fois)

  • concernant zou-events, tout fonctionne parfaitement, l'actualisation automatique se fait bien quand on a deux pages ouvertes mais au bout de quelques minutes on retrouve le message suivant:

Firefox ne peut établir de connexion avec le serveur à l’adresse http:///events.

Installation

Hey there. This is not so much an issue as a lack of my understanding.

Finally, create database tables (it is required to leave the posgres console and to activate the Zou virtual environment):

#Run it in your bash console.
DB_PASSWORD=yourdbpassword zou init_db

So as instructed, I leave postgres and exit virtualenv and am back as my user and are told to run this DB_PASSWORD command.
And my beginner understanding says this doesn't look like a command and when I enter it I get the expected:

chirp@chirp:/opt/zou$ DB_PASSWORD=mysecretpassword zou init_db
Command 'zou' not found, did you mean:
command 'zmu' from deb zoneminder (1.32.3-2build1)

Sorry, I know this is probably really dumb, but could you please instruct me on what to do here?

Thanks

create_admin does not create valid account

Hi,

I followed installation guide at https://zou.cg-wire.com/#install to install Zou 0.11 in my local computer and found that the command

DB_PASSWORD=yourdbpassword zou create_admin [email protected]

does not allow me to create a valid admin account

(zouenv) ubuntu@mts2:/opt/zou$ DB_PASSWORD=xxxxx zou create_admin [email protected]
Admin successfully created.

It does not ask me to specify a password. So I logged in using "default" as password as the docs says

Then your user will be created with the email as login, default as password and "Super Admin" as first name and last name.

However, login with such credentials does not work.

It says

Log in failed, please verify your credentials 

Basically I understand that admin account must be activated first. However, the installation guide says nothing about email server configuration. Also, when the admin account is created without verification and email server not properly setup, there is no feature to fix it.

Is it a bug or am I missing something?

Regards,

Dinh

Task estimation time can not be a float

Apparently, when setting the estimation time of a task, we can only set an int. Any other try, with a dot or comma makes the action runs forever without feedback. Meanwhile in the server, an error message is raised. It's obvious here that an int is required.

[SQL: 'UPDATE task SET updated_at=%(updated_at)s, estimation=%(estimation)s WHERE task.id = %(task_id)s'] [parameters: {'updated_at': datetime.datetime(2019, 2, 20, 10, 28, 14, 586337), 'estimation': '', 'task_id': UUID('5daa066c-c727-435a-a84c-b344f85617f4')}] (Background on this error at: http://sqlalche.me/e/9h9h)
[2019-02-20 10:28:30,167] ERROR in base: (psycopg2.DataError) invalid input syntax for integer: "3.4"
LINE 1: ...019-02-20T10:28:30.152769'::timestamp, estimation='3.4' WHER..

So how to set a 2 hours estimated task ?
And the gui should return an error maybe ? Or allow only for ints inputs.

LDAP sync failing on previously created accounts

If I have created an account, for example the first admin account, with an email also present in the LDAP, there is an error while synchronizing the LDAP with the zou sync_with_ldap_server utility.

sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "person_email_key"
DETAIL: Key (email)=([email protected]) already exists

Only the desktop login appears to be tested https://github.com/cgwire/zou/blob/master/zou/app/utils/commands.py#L240-L244

werkzeug version

Hi,

Just upgraded to zou 0.10.20 to test API event changes and saw this in the pip output:

flask 1.1.1 has requirement Werkzeug>=0.15, but you'll have werkzeug 0.14.1 which is incompatible.

Cameron

Mismatching values between shots/assets and entities path

Issue:

When querying shots or assets with the REST api I get key with mismatching values. In the following example I queried a shot with the shots and entities path and I get a mismatch on the type key and the source_id key.
Also, I'm wondering if is it normal that the source_id default value is the string "None" instead of a null ?

Examples:

/api/data/shots

{
	"canceled": false,
	"data": {},
	"description": null,
	"entity_type_id": "fc757eb4-8f3f-4fce-adce-3b665c28d737",
	"episode_id": "e3ae3a2d-63ac-4a65-8bce-5453759f398a",
	"episode_name": "E01",
	"fps": null,
	"frame_in": null,
	"frame_out": null,
	"id": "0147e85e-df1a-409b-a495-f98cf0c8abe7",
	"name": "sh02",
	"nb_frames": null,
	"parent_id": "66a18ac0-d710-473c-83ca-a3010f3a14e9",
	"preview_file_id": "",
	"project_id": "66b51720-1e5c-4599-8c98-f8f3c901b7fb",
	"project_name": "truc ",
	"sequence_id": "66a18ac0-d710-473c-83ca-a3010f3a14e9",
	"sequence_name": "sq01",
	"source_id": "None",
	"tasks": [],
	"type": "Shot"
}

/api/data/entities

{
	"entities_out": [],
	"instance_casting": [],
	"created_at": "2020-09-02T13:11:45",
	"updated_at": "2020-09-02T13:11:45",
	"id": "0147e85e-df1a-409b-a495-f98cf0c8abe7",
	"name": "sh02",
	"code": null,
	"description": null,
	"shotgun_id": null,
	"canceled": false,
	"nb_frames": null,
	"project_id": "66b51720-1e5c-4599-8c98-f8f3c901b7fb",
	"entity_type_id": "fc757eb4-8f3f-4fce-adce-3b665c28d737",
	"parent_id": "66a18ac0-d710-473c-83ca-a3010f3a14e9",
	"source_id": null,
	"preview_file_id": null,
	"data": null,
	"entities_in": [],
	"type": "Entity"
}

Cg-Wire version: Kitsu 0.12.0 // Zou 0.12.0

"Add comment" raise a 404 error

When I use gazu.task.add_comment or gazu.task.add_preview, a RouteNotFoundException.

RouteNotFoundException: actions/tasks/d391f959-23ff-4fec-a09c-4aa5e83ed057/comment

The Zou log looks like this :

"POST //actions/tasks/b25991bc-f6cc-4656-9387-42c8006edc87/comment HTTP/1.0" 404 136 "-" "python-requests/2.18.4"

event_handlers not working

i havent been able to get my event handler to work. it crashes zou
it keeps throwing the error below
[2020-11-16 12:09:19 +0100] [14752] [ERROR] Exception in worker process Traceback (most recent call last): File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker worker.init_process() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/workers/ggevent.py", line 162, in init_process super().init_process() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process self.load_wsgi() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi self.wsgi = self.app.wsgi() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load return self.load_wsgiapp() File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp return util.import_app(self.app_uri) File "/opt/zou/zouenv/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app mod = importlib.import_module(module) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/opt/zou/zouenv/lib/python3.8/site-packages/zou/app/__init__.py", line 129, in <module> load_api() File "/opt/zou/zouenv/lib/python3.8/site-packages/zou/app/__init__.py", line 123, in load_api api.configure(app) File "/opt/zou/zouenv/lib/python3.8/site-packages/zou/app/api.py", line 36, in configure load_plugins(app) File "/opt/zou/zouenv/lib/python3.8/site-packages/zou/app/api.py", line 90, in load_plugins load_plugin(app, plugin) File "/opt/zou/zouenv/lib/python3.8/site-packages/zou/app/api.py", line 115, in load_plugin for (route_path, resource) in plugin.routes AttributeError: module 'event_handlers' has no attribute 'routes'
pls how can i fix it

Travis CI is broken

Tests are running well on a local installation but they are failing when running on Travis CI. There is no clear reason coming from test output.

Duplicate description in zou commands help

The zou subcommands migrate_db, upgrade_db and stamp_db share the same description in the help. This makes it difficult to figure out which command should be used when updating zou to a newer version.

$ zou   
Usage: zou [OPTIONS] COMMAND [ARGS]...                                                                       
                                                                                                             
Options:                                                                                                     
  --help  Show this message and exit.                                                                        
                                                                                                             
Commands:                                                                                                    
  clean_auth_tokens               Remove revoked and expired tokens.                                         
  clear_all_auth_tokens           Remove all authentication tokens.                                          
  clear_db                        Drop all tables from database                                              
  create_admin                    Create an admin user to allow usage of                                     
                                  the...                                                                     
  init_data                                                                                                  
  init_db                         Creates datababase table (database must                                    
                                  be...                                                                      
  migrate_db                      Upgrade database schema.                    <--- HERE
  patch_file_storage              Patch to run after upgrade from 0.7.6 or...                                
  patch_scene_asset_instance      Patch to run after upgrade from 0.6.1 or...                                
  patch_set_done_flag_on_task_status                                                                         
                                  Patch to run after upgrade from 0.4.8 or...                                
  patch_task_type_allow_timelog   Patch to run after upgrade from 0.7.3 or...                                
  patch_team                      Patch to run after upgrade from 0.7.10 or...                               
  reset_db                        Drop all tables then recreates them.                                       
  set_default_password            Set the password of given user as default                                  
  stamp_db                        Upgrade database schema.                    <--- HERE
  upgrade_db                      Upgrade database schema.                    <--- HERE

can not send email

sorry for my bad english.
The problem:
1,already install zou and cgwire
2, config email environment done. use online smtp server(smtp.163.com)
3, when send invitation got error:
[2019-11-08 16:58:17,362] ERROR in __init__: Traceback (most recent call last): File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_restful/__init__.py", line 458, in wrapper resp = resource(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.6/site-packages/flask/views.py", line 89, in view return self.dispatch_request(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_restful/__init__.py", line 573, in dispatch_request resp = meth(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_jwt_extended/view_decorators.py", line 103, in wrapper return fn(*args, **kwargs) File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/blueprints/persons/resources.py", line 209, in get persons_service.invite_person(person_id) File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/services/persons_service.py", line 297, in invite_person emails.send_email(subject, body, person.email) File "/opt/zou/zouenv/lib/python3.6/site-packages/zou/app/utils/emails.py", line 11, in send_email mail.send(message) File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_mail.py", line 491, in send with self.connect() as connection: File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_mail.py", line 144, in __enter__ self.host = self.configure_host() File "/opt/zou/zouenv/lib/python3.6/site-packages/flask_mail.py", line 156, in configure_host host = smtplib.SMTP_SSL(self.mail.server, self.mail.port) File "/usr/lib/python3.6/smtplib.py", line 1031, in __init__ source_address) File "/usr/lib/python3.6/smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) File "/usr/lib/python3.6/smtplib.py", line 336, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python3.6/smtplib.py", line 1037, in _get_socket self.source_address) File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/socket.py", line 83, in create_connection addrs = list(getaddrinfo(host, port, 0, SOCK_STREAM)) File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/_socketcommon.py", line 212, in getaddrinfo addrlist = get_hub().resolver.getaddrinfo(host, port, family, type, proto, flags) File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/resolver/thread.py", line 65, in getaddrinfo return self.pool.apply(_socket.getaddrinfo, args, kwargs) File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/pool.py", line 159, in apply return self.spawn(func, *args, **kwds).get() File "src/gevent/event.py", line 268, in gevent._event.AsyncResult.get File "src/gevent/event.py", line 296, in gevent._event.AsyncResult.get File "src/gevent/event.py", line 286, in gevent._event.AsyncResult.get File "src/gevent/event.py", line 266, in gevent._event.AsyncResult._raise_exception File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/_compat.py", line 47, in reraise raise value.with_traceback(tb) File "/opt/zou/zouenv/lib/python3.6/site-packages/gevent/threadpool.py", line 281, in _worker value = func(*args, **kwargs) socket.gaierror: [Errno -2] Name or service not known

need for help for that.
thanks .

LDAP Sync broken

Issue:

I tried to update Zou to 0.9.13 but the LDAP synchronization failed and corrupts a user mail with '[]'. The LDAP_EXCLUDED_ACCOUNTS key seems to also be malfunctionning, the user "Invité" should not be processed.
However, the 0.9.10 works correctly, except the EMAIL_DOMAIN which has no effects.

Traceback:
[Synchro LDAP]
/opt/zou/env/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
User Invité updated.
Traceback (most recent call last):
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
psycopg2.IntegrityError: duplicate key value violates unique constraint "person_email_key"
DETAIL:  Key (email)=([]) already exists.


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

Traceback (most recent call last):
  File "/opt/zou/env/bin/zou", line 10, in <module>
    sys.exit(cli())
  File "/opt/zou/env/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/zou/env/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/zou/env/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/zou/env/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/zou/env/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/zou/env/lib/python3.5/site-packages/zou/cli.py", line 153, in sync_with_ldap_server
    commands.sync_with_ldap_server()
  File "/opt/zou/env/lib/python3.5/site-packages/zou/app/utils/commands.py", line 242, in sync_with_ldap_server
    update_person_list_with_ldap_users(ldap_users)
  File "/opt/zou/env/lib/python3.5/site-packages/zou/app/utils/commands.py", line 211, in update_person_list_with_ldap_users
    "last_name": last_name
  File "/opt/zou/env/lib/python3.5/site-packages/zou/app/services/persons_service.py", line 190, in update_person
    person.update(data)
  File "/opt/zou/env/lib/python3.5/site-packages/zou/app/models/base.py", line 148, in update
    db.session.commit()
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/scoping.py", line 153, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 937, in commit
    self.transaction.commit()
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 461, in commit
    self._prepare_impl()
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
    self.session.flush()
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2237, in flush
    self._flush(objects)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2363, in _flush
    transaction.rollback(_capture_exception=True)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2327, in _flush
    flush_context.execute()
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 391, in execute
    rec.execute(self)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 556, in execute
    uow
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 177, in save_obj
    mapper, table, update)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 768, in _emit_update_statements
    execute(statement, multiparams)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) duplicate key value violates unique constraint "person_email_key"
DETAIL:  Key (email)=([]) already exists.
 [SQL: 'UPDATE person SET updated_at=%(updated_at)s, email=%(email)s WHERE person.id = %(person_id)s'] [parameters: {'updated_at': datetime.datetime(2019, 2, 21, 16, 22, 25, 625325), 'email': '[]', 'person_id': UUID('d1a5dd44-1aa3-4ad9-b042-4afde87f6a41')}] (Background on this error at: http://sqlalche.me/e/gkpj)

Installation Zou

Hi there,

I am trying to setup the zou API on my raspberry4 for testing purposes. I followed the documentation for installation. When i try executing the following command:
DB_PASSWORD=yourdbpassword zou init_db
i get the following message:
Cannot access to the required Redis instance

In the doc it says: "Currently Redis require no extra configuration."
I am new to redis and server-related stuff in general so i guess there is a step i am missing that might be very obvious.

Thanks for supplying these tools!

Email environment variable settings not working

Hi,

I've tried using the MAIL_SERVER, MAIL_DEBUG, MAIL_DEFAULT_SENDER and DOMAIN_NAME environment variable settings in the systemd services file, but the defaults from zou/app/config.py are always used. I tried editing the defaults in the config.py and that worked.

I used tcpdump verify that zou was trying to connect to the stmp port on localhost.

The DB_, KV_ and SECRET_KEY variables all work fine from what I've tried so far.

Running:
zou 0.9.21
on Fedora 29
with Python 3.7.2

Thanks.

Errors appear when upgrading ZOU

Hello, I need help.
Errors appear when upgrading ZOU

UPGRADE ZOU
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.

Tell me how to solve this problem.

Error with gazu.project.update_project_data() in 0.10.26

Hello,

Since Zou version 0.10.26, an error is returned by Zou when using the gazu.project.update_project_data() method (works in 0.10.25).

Here is the error returned by Gazu:

Traceback (most recent call last):
  File "zou_setup.py", line 478, in save
    gazu.project.update_project_data( project, project_data )
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gazu/project.py", line 124, in update_project_data
    update_project(project)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gazu/project.py", line 104, in update_project
    return client.put("data/projects/%s" % project["id"], project)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gazu/client.py", line 176, in put
    check_status(response, path)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/gazu/client.py", line 247, in check_status
    raise ServerErrorException(path)
gazu.exception.ServerErrorException: data/projects/a842387e-5ed5-4ee3-89db-a4d5b28cc8d2

And here is the error present in '/opt/zou/logs/gunicorn_error.log':

[2019-09-13 11:58:06 +0200] [14199] [ERROR] Error handling request //data/projects/c630d973-9306-4d71-b04c-b7fa3c43bdf6
Traceback (most recent call last):
  File "/opt/zou/zouenv/lib/python3.5/site-packages/gunicorn/workers/base_async.py", line 56, in handle
    self.handle_request(listener_name, req, client, addr)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/gunicorn/workers/ggevent.py", line 160, in handle_request
    addr)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/gunicorn/workers/base_async.py", line 107, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
   return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 458, in wrapper
    resp = resource(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/flask_jwt_extended/view_decorators.py", line 103, in wrapper
    return fn(*args, **kwargs)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/crud/base.py", line 276, in put
    instance.update(data)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/models/base.py", line 190, in update
    setattr(self, key, value)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/attributes.py", line 268, in __set__
    instance_state(instance), instance_dict(instance), value, None
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/attributes.py", line 1310, in set
    new_values, old_collection, new_collection, initiator=evt
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/collections.py", line 798, in bulk_replace
    appender(member, _sa_initiator=initiator)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/collections.py", line 1113, in append
    item = __set(self, item, _sa_initiator)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/collections.py", line 1078, in __set
    item = executor.fire_append_event(item, _sa_initiator)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/collections.py", line 715, in fire_append_event
    self.owner_state, self.owner_state.dict, item, initiator
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/attributes.py", line 1151, in fire_append_event
    value = fn(state, value, initiator or self._append_token)
  File "/opt/zou/zouenv/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 45, in append
    item_state = attributes.instance_state(item)
AttributeError: 'str' object has no attribute '_sa_instance_state'

Improve plugins mechanism

Zou try to import event_handlers (module name is hardcoded). By default, this work only when the current working directory contains such a module - this is the case when current working directory is the source directory.

Instead of importing event_handlers, another mechanism should be used, for example.

LDAP Environment variable LDAP_IS_AD not working properly

On the zou.service file, while connecting to an LDAP server you can use the LDAP_IS_AD variable. But it does not appears to create a boolean while initializing the zou instance, so it does not work as expected later on.

It's true at least using :
Environment="LDAP_IS_AD=False"
The LDAP connection is returning :

raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type'])
ldap3.core.exceptions.LDAPAuthMethodNotSupportedResult: LDAPAuthMethodNotSupportedResult - 7 - authMethodNotSupported - None - unknown authentication method - bindResponse - None

So far, leaving that variable unset (which is defined to False by Default) works in my case

Non ActiveDirectory LDAP not working

Hi !
We are using a LDAP directory in our infrastructure but it' s not Active Directory. So the implementation is different in some points. That said, the sync (and obviously the authentication) are not working out of the box. Some parameters are changing, some attributes do not exists.

Based on the current sync script, I tried to edit what has to change in order to work in our case (using a synology LDAP service). Differences are pointed in the comments

import ldap3
import os

LDAP_HOST = os.getenv("LDAP_HOST", "127.0.0.1")
LDAP_PORT = os.getenv("LDAP_PORT", "389")
LDAP_PASSWORD = os.getenv("LDAP_PASSWORD", "")
LDAP_BASE_DN = os.getenv("LDAP_BASE_DN", "cn=Users,dc=studio,dc=local")
LDAP_DOMAIN = os.getenv("LDAP_DOMAIN", "")
LDAP_USER = os.getenv("LDAP_USER", "")
EMAIL_DOMAIN = os.getenv("EMAIL_DN", "studio.local")
LDAP_EXCLUDED_ACCOUNTS = os.getenv("LDAP_EXCLUDED_ACCOUNTS", "")

# Main changes are in the user and server : 
# BEFORE : 
user = "%s\%s" % (LDAP_DOMAIN, LDAP_USER)
ldap_server = "%s:%s" % (LDAP_HOST, LDAP_PORT)
# AFTER : 
user = "uid=%s,%s" % (LDAP_USER, LDAP_BASE_DN) 
ldap_server = LDAP_HOST # No Domain

server = ldap3.Server(ldap_server, get_info=ldap3.ALL)
conn = ldap3.Connection(
    LDAP_HOST,
    user=user,
    password=LDAP_PASSWORD,
    # authentication=ldap3.NTLM, # NTLM -> Microsoft auth, not working here
    raise_exceptions=True,
    auto_bind=True)

attributes = [
           "givenName",
           "sn",
           #"sAMAccountName", -> Microsoft identifier, not available
           "mail",
           #"thumbnailPhoto" -> attribute not available neither 
       ]
conn.search(LDAP_BASE_DN, '(objectclass=person)', attributes=attributes)

for entry in conn.entries:
    print(entry)

As for attributes, some works, some don't has specified in the comments. But even though they work, we are not using them. So how can we specify which attributes to use ? Example, sAMAccountName might be replaced by attribute cn or uid. We have nothing to use as thumbnailPhoto, the first and last name are stored in another place (which I won't trust to be right and looks more a Synology wrong usage of the field). We also might use the ShadowExpire to know if a user can or can not log in (user disabled set the value of that attribute to -1)
Which other information do you need ?
Cheers !

Test not passing on gitlab

After rebasing our fork on the official master branch we still get 2 tests failing (on our gitlab server)

Gitlab CI file

stages:
  - test

tests:python:
  stage: test
  image: python:3
  services:
    - postgres:9
  variables:
    AUTH_STRATEGY: auth_local_no_password
    DB_HOST: postgres
    POSTGRES_DB: zoudb
    POSTGRES_PASSWORD: mysecretpassword
    POSTGRES_USER: postgres
    PREVIEW_FOLDER: ./data
  script:
    # Create thumbnail folder
    - mkdir -p $PREVIEW_FOLDER

    # Install pg_dump
    - apt-get update
    - apt-get install postgresql-client --yes

    # Install requirements
    - pip install -r requirements.txt

    # Run Tests
    - PYTHONPATH=. py.test --ignore=tests/auth/test_auth_route.py
  tags:
    - test

pytest fail report

=================================== FAILURES ===================================
___________________ RouteThumbnailTestCase.test_add_preview ____________________

self = <tests.thumbnails.test_route_thumbnail.RouteThumbnailTestCase testMethod=test_add_preview>

    def test_add_preview(self):
        path = "/pictures/preview-files/%s" % self.preview_file_id
    
        file_path_fixture = self.get_fixture_file_path(
                os.path.join("thumbnails", "th01.png"))
        self.upload_file(path, file_path_fixture)
    
        current_path = os.path.dirname(__file__)
        result_file_path = os.path.join(TEST_FOLDER, "th01.png")
        result_file_path = os.path.join(
            current_path, "..", "..", result_file_path)
        os.mkdir(TEST_FOLDER)
    
        path = "/pictures/previews/preview-files/%s.png" % self.preview_file_id
>       self.download_file(path, result_file_path)

tests/thumbnails/test_route_thumbnail.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/base.py:205: in download_file
    self.assertEqual(response.status_code, code)
E   AssertionError: 404 != 200
----------------------------- Captured stdout call -----------------------------
2019-10-11 15:30:26,560 - ERROR - [Errno 2] No such file or directory: '/builds/antoine.boellinger/zou/zou/app/./data/pictures/previews/177/e12/177e12fd-14f4-4de4-9ba9-3606f04cb2e7'
------------------------------ Captured log call -------------------------------
ERROR    zou.app:resources.py:120 [Errno 2] No such file or directory: '/builds/antoine.boellinger/zou/zou/app/./data/pictures/previews/177/e12/177e12fd-14f4-4de4-9ba9-3606f04cb2e7'
__________________ RouteThumbnailTestCase.test_add_thumbnail ___________________

self = <tests.thumbnails.test_route_thumbnail.RouteThumbnailTestCase testMethod=test_add_thumbnail>

    def test_add_thumbnail(self):
        path = "/pictures/thumbnails/persons/%s" % self.person.id
    
        file_path_fixture = self.get_fixture_file_path(
                os.path.join("thumbnails", "th01.png"))
        self.upload_file(path, file_path_fixture)
    
        path = "/pictures/thumbnails/persons/%s.png" % self.person.id
        current_path = os.path.dirname(__file__)
        result_file_path = os.path.join(TEST_FOLDER, "th01.png")
        result_file_path = os.path.join(
            current_path, "..", "..", result_file_path)
    
        os.mkdir(TEST_FOLDER)
>       self.download_file(path, result_file_path)

tests/thumbnails/test_route_thumbnail.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/base.py:205: in download_file
    self.assertEqual(response.status_code, code)
E   AssertionError: 404 != 200
----------------------------- Captured stdout call -----------------------------
2019-10-11 15:30:28,906 - ERROR - [Errno 2] No such file or directory: '/builds/antoine.boellinger/zou/zou/app/./data/pictures/thumbnails/62a/e43/62ae436a-40a5-4521-b816-984cd3a369b3'
------------------------------ Captured log call -------------------------------
ERROR    zou.app:resources.py:120 [Errno 2] No such file or directory: '/builds/antoine.boellinger/zou/zou/app/./data/pictures/thumbnails/62a/e43/62ae436a-40a5-4521-b816-984cd3a369b3'

Any idea on what could cause this issue ?

Query login tokens through browser session

Idea

Would it be possible to query the currently logged in user through a browser session so that, to login with gazu one does not need to enter credentials if they are currently logged in online.

I've seen some code for this with other production trackers/managers and was wondering whether that could be a possibility here too?

Reference implementation:

Long and short names.

Issue

Defining long names for properties might cause issue when mapping to other systems.

Description

This issue originated from Avalon where a project with whitespaces does not comply with Avalon's database.

Commonly among production trackers are a way to define a long and short name for a property. The long name is a visual aid for the end user, and the short name is for code.

Long and short name might not be the best definition. Other options include:

  • Label/name
  • Name/code

s3 backend us-east-1 boto3 workaround

Hey I just started playing around with zou, and it is great! I found a little bug that is pretty easy to fix. I have never done a PR before, is this something I should do or is it small enough that it would be easier for someone else to take care of?

I was getting a LocationConstraint Error when trying to use s3. I found this Boto3 Issue , which seems to indicate that "us-east-1" is a special case and should not be used with LocationConstraint.

file_store.py

    try:
        self.bucket.create(
            CreateBucketConfiguration={
                'LocationConstraint': config.region
            }
        )
    except self.s3.meta.client.exceptions.BucketAlreadyOwnedByYou:
        pass

I changed it to

    try:
        if config.region == "us-east-1":
            self.bucket.create()
        else:
            self.bucket.create(
                CreateBucketConfiguration={
                    'LocationConstraint': config.region
                }
            )
    except self.s3.meta.client.exceptions.BucketAlreadyOwnedByYou:
        pass

And that seemed to do the trick.

relations parameter in get request

Hello,

Zou allow to retrieve entities with or without serialized related entities (attributes declared as sqlalchemy relationship.
For example outputs in WorkingFile model.

Sometime we need to query entities with their relatations but there is no way to specify it.
Could we consider add a with_relation paramater to get requests to retrieve entites with or without their relations ?
Default value would be False to stay as fast as possible.

Event Handlers: How do I install non native pip modules to be recognized by custom module?

My event_handlers folder looks like:
-- init.py
-- hanlder.py
-- my_module

  • init.py:
from . import handler

event_map = {
    "task:update": hanlder,
}
  • handler.py:
from flask import current_app
import my_module

def handle_event(data):
    current_app.logger.error("Module working")
    my_module.qarnot_auto_render.main(data)

Also, in my_module, I import non native modules from pip (like gazu or qarnot).

But it seems not loading, I don't have any message in /opt/zou/logs/gunicorn_error.log when I update a task. I should see the error message.

PREVIEW_FOLDER default value

In the documentation, the value of PREVIEW_FOLDER is mentioned to be /usr/local/share/zou/standard, but looking at config.py I find this:

PREVIEW_FOLDER = os.getenv("PREVIEW_FOLDER", os.getenv("THUMBNAIL_FOLDER", "previews"))

on macOS this leads to thumbnails not being saved:

127.0.0.1 - - [30/Aug/2020 18:52:23] "POST /pictures/thumbnails/persons/c2f40d61-e83c-4f6c-b24f-67c9b19e33b5 HTTP/1.1" 201 -
[2020-08-30 18:52:23,722] ERROR in resources: [Errno 2] No such file or directory: '/Users/fsiddi/Developer/zou/zou/app/previews/pictures/thumbnails/c2f/40d/c2f40d61-e83c-4f6c-b24f-67c9b19e33b5'
127.0.0.1 - - [30/Aug/2020 18:52:23] "GET /pictures/thumbnails/persons/c2f40d61-e83c-4f6c-b24f-67c9b19e33b5.png?unique=zdhb5 HTTP/1.1" 404 -

After manually setting PREVIEW_FOLDER to an absolute path I was able to save previews correctly. I think it might be a good idea to clarify the default value, but I'm not sure about the expectations for the default behavior.

Events handlers doesn't work

I've followed this doc: https://zou.cg-wire.com/events/

I've created my own directory for events handlers in zou.service:

Environment="EVENT_HANDLERS_FOLDER=/home/user/apps/zou/handlers"

I've given the ownership to zou for this folder.
I've restarted zou service.

I've created the __init__py:

import test
 
event_map = {
    "asset:new": test,
}

I've created a test.py:

def handle_event(data):
    with open("Output.txt", "w") as text_file:
        print(data, file=text_file)

I create a new asset, but it doesn't create my file.

Also, I know where to look at this print(), as the documentation uses it.

Problem with asset creation

When trying to create an asset on the assets page, this error comes out :

Creation or edition failed, an error occured.

The logs of Firefox :

"(psycopg2.IntegrityError) null value in column "project_id" violates not-null constraint\nDETAIL: Failing row contains (2017-07-27 05:11:11.944184, 2017-07-27 05:11:11.944193, 2cbff8c8-8472-4b9b-9bfa-29d4c8228f64, test, null, null, null, null, null, null).\n [SQL: 'INSERT INTO entity (created_at, updated_at, id, name, description, shotgun_id, project_id, entity_type_id, parent_id) VALUES (%(created_at)s, %(updated_at)s, %(id)s, %(name)s, %(description)s, %(shotgun_id)s, %(project_id)s, %(entity_type_id)s, %(parent_id)s)'] [parameters: {'project_id': None, 'name': 'test', 'id': UUID('2cbff8c8-8472-4b9b-9bfa-29d4c8228f64'), 'created_at': datetime.datetime(2017, 7, 27, 5, 11, 11, 944184), 'description': None, 'parent_id': None, 'updated_at': datetime.datetime(2017, 7, 27, 5, 11, 11, 944193), 'entity_type_id': None, 'shotgun_id': None}]"

The JSON data looks like this :

{"name":"test"}

Maybe some data is missing in the dictionary...

Error deleting user

I need to delete the user. When deleting, an error occurs: "An error occured while deleting this person. There are probably data linked to it. Are you sure this person has no assignation or wrote no comment?"

ERROR: update or delete on table "person" violates foreign key constraint "api_event_user_id_fkey" on table "api_event"
DETAIL: Key (id)=(0e4bd876-8d7f-438b-abb7-368344aaecf3) is still referenced from table "api_event".
STATEMENT: DELETE FROM person WHERE person.id = '0e4bd876-8d7f-438b-abb7-368344aaecf3'::uuid

The problem appears after deleting the project in which there was a task for the user.

FFMPEG Normalization error

Hello,
I'm facing some issues while uploading video files mov / mp4 .h264 - file size is not an issue, tested 600KB and 20MB.
I can not find where ffmpeg stderr is located - here's gunicorn_error.log I have after upload:
[2020-11-04 05:01:36,445] ERROR in resources: ffmpeg error (see stderr output for detail) Traceback (most recent call last): File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/previews/resources.py", line 202, in post self.save_movie_preview(instance_id, uploaded_file) File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/previews/resources.py", line 259, in save_movie_preview uploaded_movie_path, fps=fps, width=width, height=height File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/utils/movie_utils.py", line 84, in normalize_movie stream.run(quiet=False, capture_stderr=True) File "/opt/zou/zouenv/lib/python3.5/site-packages/ffmpeg/_run.py", line 325, in run raise Error('ffmpeg', out, err) ffmpeg._run.Error: ffmpeg error (see stderr output for detail) [2020-11-04 05:01:36,446] ERROR in resources: Normalization failed. [2020-11-04 05:04:14,444] ERROR in movie_utils: b"ffmpeg version 2.8.17-0ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers\n built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 20160609\n configuration: --prefix=/usr --extra-v$ [2020-11-04 05:04:14,445] ERROR in resources: ffmpeg error (see stderr output for detail) Traceback (most recent call last): File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/previews/resources.py", line 202, in post self.save_movie_preview(instance_id, uploaded_file) File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/blueprints/previews/resources.py", line 259, in save_movie_preview uploaded_movie_path, fps=fps, width=width, height=height File "/opt/zou/zouenv/lib/python3.5/site-packages/zou/app/utils/movie_utils.py", line 84, in normalize_movie stream.run(quiet=False, capture_stderr=True) File "/opt/zou/zouenv/lib/python3.5/site-packages/ffmpeg/_run.py", line 325, in run raise Error('ffmpeg', out, err) ffmpeg._run.Error: ffmpeg error (see stderr output for detail) [2020-11-04 05:04:14,445] ERROR in resources: Normalization failed.

I'd be glad if anyone could help me with that one!
Thanks in advace!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.