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

Can't add annotator to project #70

Open
RaulKite opened this issue Mar 30, 2023 · 12 comments
Open

Can't add annotator to project #70

RaulKite opened this issue Mar 30, 2023 · 12 comments

Comments

@RaulKite
Copy link

Hi,I just have installed RapidAnnotator and I can't add annotator to a project.

My logs show this lines all the time:

rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.382414 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516] FROM `FileCaption` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.382417 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516] WHERE `FileCaption`.file_id = %s , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.382420 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516]  LIMIT %s, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.382480 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516] 2023-03-30 07:25:18,382 INFO sqlalchemy.engine.Engine [cached since 449.6s ago] (10, 1), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.383846 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516] 2023-03-30 07:25:18,383 INFO sqlalchemy.engine.Engine SELECT count(*) AS count_1 , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:25:18.383873 2023] [wsgi:error] [pid 13:tid 281471881244992] [client 172.18.0.1:55516] FROM (SELECT `File`.id AS `File_id`, `File`.experiment_id AS `File_experiment_id`, `File`.name AS `File_name`, `File`.content AS `File_content`, `File`.edge_link AS `File_edge_link`, `File`.`concordance_lineNumber` AS `File_concordance_lineNumber`, `File`.display_order AS `File_display_order` , referer: http://localhost:8000/add_experiment/viewSettings/1

and when I add an annotator and edit it, I get this error:

rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:50.999841 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] FROM `User` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:50.999843 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] WHERE `User`.id = %s, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:50.999945 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] 2023-03-30 07:30:50,999 INFO sqlalchemy.engine.Engine [cached since 909.3s ago] (1,), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.003380 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] 2023-03-30 07:30:51,003 INFO sqlalchemy.engine.Engine SELECT `AnnotatorAssociation`.id AS `AnnotatorAssociation_id`, `AnnotatorAssociation`.experiment_id AS `AnnotatorAssociation_experiment_id`, `AnnotatorAssociation`.user_id AS `AnnotatorAssociation_user_id`, `AnnotatorAssociation`.start AS `AnnotatorAssociation_start`, `AnnotatorAssociation`.end AS `AnnotatorAssociation_end`, `AnnotatorAssociation`.current AS `AnnotatorAssociation_current` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.003422 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] FROM `AnnotatorAssociation` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.003426 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] WHERE `AnnotatorAssociation`.experiment_id = %s AND `AnnotatorAssociation`.user_id = %s , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.003429 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]  LIMIT %s, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.003644 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] 2023-03-30 07:30:51,003 INFO sqlalchemy.engine.Engine [cached since 347.4s ago] ('1', '1', 1), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.005891 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] 2023-03-30 07:30:51,005 INFO sqlalchemy.engine.Engine ROLLBACK, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007306 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] mod_wsgi (pid=12): Exception occurred processing WSGI script '/var/www/rapidannotator/wsgi.py'., referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007901 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] Traceback (most recent call last):, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007975 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2551, in __call__, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007980 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     return self.wsgi_app(environ, start_response), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007985 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2531, in wsgi_app, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007988 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     response = self.handle_exception(e), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007992 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 2528, in wsgi_app, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.007995 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     response = self.full_dispatch_request(), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008002 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1825, in full_dispatch_request, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008005 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     rv = self.handle_user_exception(e), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008008 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1823, in full_dispatch_request, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008011 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     rv = self.dispatch_request(), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008015 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1799, in dispatch_request, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008018 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008023 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]   File "/var/www/rapidannotator/rapidannotator/modules/add_experiment/views.py", line 1040, in _editAnnotator, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008025 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142]     annotatorDetails.start = request.args.get('start', annotatorDetails.start), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:51.008041 2023] [wsgi:error] [pid 12:tid 281473041711424] [client 172.18.0.1:44142] AttributeError: 'NoneType' object has no attribute 'start', referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | 172.18.0.1 - - [30/Mar/2023:07:30:50 +0000] "GET /add_experiment/_editAnnotator?annotatorId=1&experimentId=1&start=0&end=10 HTTP/1.1" 500 608
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.290079 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,289 INFO sqlalchemy.engine.Engine BEGIN (implicit), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.291046 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,290 INFO sqlalchemy.engine.Engine SELECT `User`.id AS `User_id`, `User`.username AS `User_username`, `User`.fullname AS `User_fullname`, `User`.email AS `User_email`, `User`.password AS `User_password`, `User`.`registeredOn` AS `User_registeredOn`, `User`.confirmed AS `User_confirmed`, `User`.`confirmedOn` AS `User_confirmedOn`, `User`.`secKey` AS `User_secKey`, `User`.experimenter AS `User_experimenter`, `User`.`admin` AS `User_admin`, `User`.looping AS `User_looping`, `User`.`numNotif` AS `User_numNotif` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.291091 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] FROM `User` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.291096 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] WHERE `User`.id = %s, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.291296 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,291 INFO sqlalchemy.engine.Engine [cached since 915.6s ago] (1,), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.295002 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,294 INFO sqlalchemy.engine.Engine SELECT `Clustering`.id AS `Clustering_id`, `Clustering`.experiment_id AS `Clustering_experiment_id`, `Clustering`.user_id AS `Clustering_user_id`, `Clustering`.status AS `Clustering_status`, `Clustering`.display AS `Clustering_display` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.295034 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] FROM `Clustering` , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.295037 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] WHERE `Clustering`.experiment_id = %s AND `Clustering`.user_id = %s , referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.295039 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846]  LIMIT %s, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.295115 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,295 INFO sqlalchemy.engine.Engine [cached since 812.6s ago] (1, 1, 1), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:30:57.296746 2023] [wsgi:error] [pid 12:tid 281472258535744] [client 172.18.0.1:57846] 2023-03-30 07:30:57,296 INFO sqlalchemy.engine.Engine ROLLBACK, referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | 172.18.0.1 - - [30/Mar/2023:07:30:57 +0000] "POST /clustering/getStatus HTTP/1.1" 200 37
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:31:01.306515 2023] [wsgi:error] [pid 12:tid 281471470137664] [client 172.18.0.1:57846] 2023-03-30 07:31:01,306 INFO sqlalchemy.engine.Engine BEGIN (implicit), referer: http://localhost:8000/add_experiment/viewSettings/1
rapidannotator-20-rapidannotator-1  | [Thu Mar 30 07:31:01.307112 2023] [wsgi:error] [pid 12:tid 281471470137664] [client 172.18.0.1:57846] 2023-03-30 07:31:01,307 INFO sqlalchemy.engine.Engine SELECT `User`.id AS `User_id`, `User`.username AS `User_username`, `User`.fullname AS `User_fullname`, `User`.email AS `User_email`, `User`.password AS `User_password`, `User`.`registeredOn` AS `User_registeredOn`, `User`.confirmed AS `User_confirmed`, `User`.`confirmedOn` AS `User_confirmedOn`, `User`.`secKey` AS `User_secKey`, `User`.experimenter AS `User_experimenter`, `User`.`admin` AS `User_admin`, `User`.looping AS `User_looping`, `User`.`numNotif` AS `User_numNotif` , referer: http://localhost:8000/add_experiment/viewSettings/1

Can you help me to fix the error?

I'm running inside a docker container in an Ubuntu 22.10. Python version is 3.10.7

Thanks

@RaulKite
Copy link
Author

Tested in Ubuntu 20.04 and same error.

@rrrokhtar
Copy link

@RaulKite Can you try using python 3.6 or 3.7, it works properly there until I check that issue using 3.10.7
Sorry for late response.

@peteruhrig
Copy link

Hey guys, any news on this?

@RaulKite
Copy link
Author

Ups, I didn't see the answer. I'll check and write here in a couple of days.

The student is using https://beta.rapidannotator.org right now, but I want to dockerize the app and run it in our server when we have a lot of videos to upload.

@RaulKite
Copy link
Author

I can confirm that in a Ubuntu 18.04 with python 3.6 it works 👍

If you are interested, I can clean the code and make a pull request to run it in a docker compose environment in an easy way, add the documentation, ...

@peteruhrig
Copy link

This would be greatly appreciated!
Still, I think we should try to find out what goes wrong with the newer version. @rrrokhtar : Have you had time to look into this?

@RaulKite
Copy link
Author

#71 Pull request generated for docker installation

@peteruhrig
Copy link

Thanks, I have merged it. Will leave this open till we find out what breaks, though.

@rrrokhtar
Copy link

@peteruhrig Unfortunately I have not checked that yet but I will check ASAP and let you know what happens on the new python version most probably it is related to the compatibility of the packages

@rrrokhtar
Copy link

Here is an update (not a solution)

There are issues while doing that with new python version beside new flask version

As well as an error with importing JSONEncoder from flask.json. This is because Flask 2.3.0 has removed these attributes from the flask.json module. One possible solution is to uninstall Flask and install an older version, such as Flask 2.2.3.

There is a problem happens here (while using python 3.10 and 3.11):

from flask.json import JSONEncoder as BaseEncoder
from speaklater import _LazyString
class JSONEncoder(BaseEncoder):
def default(self, o):
if isinstance(o, _LazyString):
return str(o)
return BaseEncoder.default(self, o)

As well as there is something is not going well when adding an annotator there is no effect on the database
It returns success on python3.10 and 3.11 without taking effect on the db while works on 3.7/3.6 I think that comes from the changes between flask versions

@blueprint.route('/_addAnnotator', methods=['GET','POST'])
def _addAnnotator():
username = request.args.get('userName', None)
experimentId = request.args.get('experimentId', None)
experiment = Experiment.query.filter_by(id=experimentId).first()
user = User.query.filter_by(username=username).first()
alreadyExists = AnnotatorAssociation.query.filter_by(user_id = user.id, experiment_id=experimentId).first()
if (alreadyExists != None):
response = {
'success' : False,
'annotatorId' : user.id,
'annotatorUsername' : user.username,
'message' : "User already exists in this experiment"
}
return jsonify(response)
experimentAnnotator = AnnotatorAssociation()
experimentAnnotator.experiment = experiment
experimentAnnotator.annotator = user
db.session.commit()
annotatorsPlot = _annotatorsPlot(experiment)
response = {
'success' : True,
'annotatorId' : user.id,
'annotatorUsername' : user.username,
'plot': annotatorsPlot,
}
return jsonify(response)

I will go deeper with them to solve that issue

@staru09
Copy link

staru09 commented Feb 19, 2024

Is this issue open to work?

@peteruhrig
Copy link

@staru09 I'd recommend holding off at the moment, we first need to merge some changes done on a development server back to GitHub. I think this issue was addressed there, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants