asreview icon indicating copy to clipboard operation
asreview copied to clipboard

Application is hanging in project 'Warm Up' mode.

Open beffersr opened this issue 2 years ago • 4 comments

Describe the bug Application is hanging in project 'Warm Up' mode.

To Reproduce I created a project and added an .xlsx with 5 rows. In the forth step (Warm Up) I receive an error message: Failed to train the model. Try to refresh. I am working with Anaconda on Windows and I tried several different paths for ASREVIEW_PATH (~/.asreview, C:/Users/beffersr/.asreview, N:/Documents/project/.asreview, C:\Users\beffersr.asreview, N:\Documents\project.asreview)

Version information

  • OS: Windows
  • ASReview version 1.0

Additional context The terminal shows the error message: ERROR: root:argument of type 'WindowsPath' is not iterable

beffersr avatar Aug 08 '22 13:08 beffersr

Hi Rob,

Can you share your file such that we can try it on different systems? What model are you using? Default settings?

Is there a full traceback in the terminal? That might help with debugging.

I don't think you have to adjust the project path ASREVIEW_PATH.

J535D165 avatar Aug 08 '22 16:08 J535D165

Hi Jonathan,

Attached is the .xlsx file. I used the default project settings. The terminal doesn’t give a full traceback. It just says: 127.0.0.1 - - [2022-08-08 15:08:38] "POST /api/projects/333/algorithms HTTP/1.1" 200 157 0.119998 ERROR:root:argument of type 'WindowsPath' is not iterable

Thanks for looking in to it…

Rob

Van: Jonathan de Bruin @.> Verzonden: maandag 8 augustus 2022 18:36 Aan: asreview/asreview @.> CC: Rob Beffers @.>; Author @.> Onderwerp: Re: [asreview/asreview] Application is hanging in project 'Warm Up' mode. (Issue #1194)

Hi Rob,

Can you share your file such that we can try it on different systems? What model are you using? Default settings?

Is there a full traceback in the terminal? That might help with debugging.

I don't think you have to adjust the project path ASREVIEW_PATH.

— Reply to this email directly, view it on GitHubhttps://github.com/asreview/asreview/issues/1194#issuecomment-1208352217, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AATSFDNL7OMNPLGNMAJOHB3VYEZQ3ANCNFSM555C66IQ. You are receiving this because you authored the thread.Message ID: @.@.>>

Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de geadresseerde bent of dit bericht abusievelijk aan u is verzonden, wordt u verzocht dat aan de afzender te melden en het bericht te verwijderen. Het RIVM aanvaardt geen aansprakelijkheid voor schade, van welke aard ook, die verband houdt met risico's verbonden aan het elektronisch verzenden van berichten. www.rivm.nlhttp://www.rivm.nl/ De zorg voor morgen begint vandaag

This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. RIVM accepts no liability for damage of any kind resulting from the risks inherent in the electronic transmission of messages. www.rivm.nl/enhttp://www.rivm.nl/en Committed to health and sustainability

beffersr avatar Aug 09 '22 06:08 beffersr

We tried with different datasets (.csv, .ris) and we tried to install it on another PC, but always the same issue. See attached file 'screenshot.png' screenshot

When I press 'F12' in the browser, the console shows: No simulation running xhr.js:187 POST http://localhost:5000/api/projects/333/start 500 (INTERNAL SERVER ERROR) mutation.js:106 {code: 500, message: 'Failed to train the model.'}

Pressing 'Try to refresh' the console is showing the same error.

beffersr avatar Aug 11 '22 12:08 beffersr

I got the same error as @beffersr.

I ''fixed'' it by casting project.project_path to a string within the api_start and api_classify_instance functions in the webapp>api.py file.

image

image

Verrem98 avatar Aug 11 '22 13:08 Verrem98

@PeterLombaers any thoughts on this?

J535D165 avatar Sep 08 '22 13:09 J535D165

@J535D165 I think I have seen this issue before. In the legacy Makita code we also had an issue we fixed with casting a path this way. https://github.com/asreview/asreview-makita-legacy/pull/50#discussion_r955827198

jteijema avatar Sep 08 '22 14:09 jteijema

@Verrem98 Nice find!

jteijema avatar Sep 08 '22 14:09 jteijema

@J535D165 I think I have seen this issue before. In the legacy Makita code we also had an issue we fixed with casting a path this way. asreview/asreview-makita-legacy#50 (comment)

I don't think this is related.

J535D165 avatar Sep 08 '22 17:09 J535D165

It might be something related to the subprocess call (given the info provided by @Verrem98). @Verrem98 reports issues with 2 REST calls. Both calls are the only calls with a subprocess call.

https://github.com/asreview/asreview/blob/cd79627d249d9f86f25f0d9086ffa66d31243e91/asreview/webapp/api.py#L1451-L1457

https://github.com/asreview/asreview/blob/cd79627d249d9f86f25f0d9086ffa66d31243e91/asreview/webapp/api.py#L956-L980

This might be an issue with specific Windows versions and/or Python distributions/versions.

A potential solution might be:

     subprocess.Popen([ 
         _get_executable(), "-m", "asreview", "web_run_model", 
         str(project.project_path)
     ]) 

J535D165 avatar Sep 08 '22 17:09 J535D165

It turns out to be a bug in Python 3.7 on Windows. Upgrading Python will resolve the issue I think.

https://bugs.python.org/issue41649

On that issue, Eryk Sun said "The underlying subprocess.Popen class was updated in 3.8 to support path-like objects in args (with shell=False) and executable on Windows [1]. This change was not backported to 3.6 and 3.7."

The latter is because 3.6 and 3.7 only get security patches. Jani, please verify that this is still an issue with 3.8 and/or 3.9.

J535D165 avatar Sep 08 '22 17:09 J535D165

PR available now. I think we should release version 1.0.1 with this fix.

J535D165 avatar Sep 08 '22 17:09 J535D165

@beffersr and @Verrem98: we released a new version 1.0.1. Can you try whether upgrading solved your issue? If not, feel free to re-open this issue.

Rensvandeschoot avatar Sep 12 '22 11:09 Rensvandeschoot

Now it should work :) Version 1.0.3 it is.

J535D165 avatar Sep 12 '22 13:09 J535D165

We will try in a couple of days. Thanks so far :-)

beffersr avatar Sep 12 '22 13:09 beffersr