Forums

Use crm114

Sorry to be such a pain :)

My service uses crm114 but in the console -15:28 ~/capsence/metisq/foundation/classifier/crm-osx $ crm -v gives

-bash: crm: command not found

wich should result in

-This is CRM114, version 20100106-BlameMichelson (TRE 0.8.0 (BSD)) -Copyright 2001-2009 William S. Yerazunis -This software is licensed under the GPL with ABSOLUTELY NO WARRANTY

does this mean I can not use crm114

In a Bash console:

pip install --user crm114

? Jim

when u say --user you mean actually user and not my user name...
I did the pip install and when search for crm114 I get

10:02 / $ find / -name crm114

find: `/etc/ssl/private': Permission denied

10:09 / $ cd /etc/ssl/private/

bash: cd: /etc/ssl/private/: Permission denied

Am I doing something wrong here?
By the way, I have crm114 already installed in one of my own directories in home etc. Should that not work?

I think I see. The python package "crm114" which you can install with pip is just a wrapper for an binary application called crm114, which you would normally install with apt-get.

https://github.com/briancline/crm114-python/blob/v2.0.1/README.md

Unless you can figure out how to download + compile a binary manually yourself, we would have to do the installation of crm114 at our end... We'll add it to the list of things to look at next time we do a new server image build...

Well that would be great... I'll have a go in the mean time...

I have the service for development on my local Mac, with the crm114 in /foundation/classifier/crm-osx/, as it is on pythonanywhere... on my Mac it responds as expected...
I'm not a unix/linux expert but should it not work here as well...
Also required is TRE Regex Library

I've had a bit of a go at installing it, but I think you're going to struggle to get it install on PythonAnywhere. You'd want to compile it for a linux os, and you can't do it on pa itself because there's some missing dependencies (autoconf, i think)...

So you'll probably have to wait until we can schedule a new server image... Hard to say when that might be unfortunately :(

Ok... I recently installed on an ubuntu server and that was pretty straightforward.
(Also on Raspberry Pi)
I guess it is the dependencies
Well I'll have a go over the weekend... if that fails I hope you can help me.

I like your business model,

I've tried to install tre but I can not find a way do this, apparently you need something called automake. You are probably right, it will be difficult to install.

How long would it take to get a solution form you...
I'm very close to starting a new project and I would really like to test your service in that project.

Our current guestimate is that we should have it in 2 weeks or so.

Ok... thank you.

I have been trying to install... As you may now you have to install TRE before installing CRM... An error I keep running into is that ar is missing...
or at least it is noth in PATH

Is it possible to install ar? or is it available aready...

I think that's another thing we need to make sure is available in the new package build when we release it (hopefully next week). I'll make sure we test for it.

We've just released a new image. We haven't done any detailed testing, but crm -v seems to work. How do things look from your end?

I've seen that this works and usually this means it works... I only get a server error Error code: 502-backend when I try to use the service http://capsence.pythonanywhere.com/rest/echo/?some_text_here And I'm not used to read logs like this :)

2014-04-28 09:14:13 Respawned uWSGI worker 1 (new pid: 917)  
2014-04-28 09:14:13 spawned 2 offload threads for uWSGI worker 1  
2014-04-28 09:14:19 Tcl_InitNotifier: unable to start notifier thread  
2014-04-28 09:14:19   
2014-04-28 09:14:20 DAMN ! worker 1 (pid: 917) died, killed by signal 6 :( trying respawn ...  
2014-04-28 09:14:20 Respawned uWSGI worker 1 (new pid: 920)  
2014-04-28 09:14:20 spawned 2 offload threads for uWSGI worker 1  
2014-04-28 09:14:22 announcing my loyalty to the Emperor...  
2014-04-28 09:14:40 Tcl_InitNotifier: unable to start notifier thread  
2014-04-28 09:14:40   
2014-04-28 09:14:41 DAMN ! worker 1 (pid: 920) died, killed by signal 6 :( trying respawn ...  
2014-04-28 09:14:41 Respawned uWSGI worker 1 (new pid: 923)  
2014-04-28 09:14:41 spawned 2 offload threads for uWSGI worker 1  
2014-04-28 09:14:41 announcing my loyalty to the Emperor...  
2014-04-28 09:15:25 Mon Apr 28 09:15:25     2014 - received message 1 from emperor  
2014-04-28 09:15:25 ...gracefully killing workers...  
2014-04-28 09:15:25 Gracefully killing worker 1 (pid: 923)...  
2014-04-28 09:15:26 worker 1 buried after 1 seconds  
2014-04-28 09:15:26 uWSGI: GAME OVER (insert coin)  
2014-04-28 09:15:26 chdir(): No such file or directory [core/uwsgi.c line 1472]  
2014-04-28 09:15:26 VACUUM: unix socket /var/sockets/capsence.pythonanywhere.com/socket removed.  
2014-04-28 09:15:28 *** Starting uWSGI 2.0 (64bit) on [Mon Apr 28 09:15:27     2014] ***  
2014-04-28 09:15:28 compiled with version: 4.8.1 on 16 April     2014 18:29:59  
2014-04-28 09:15:28 os: Linux-3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC     2014  
2014-04-28 09:15:28 nodename: giles-liveweb4  
2014-04-28 09:15:28 machine: x86_64  
2014-04-28 09:15:28 clock source: unix  
2014-04-28 09:15:28 pcre jit disabled  
2014-04-28 09:15:28 detected number of CPU cores: 2  
2014-04-28 09:15:28 current working directory: /etc/uwsgi/vassals  
2014-04-28 09:15:28 detected binary path: /usr/local/bin/uwsgi  
2014-04-28 09:15:28 using Linux cgroup /mnt/cgroups/cpu/user_types/free with mode 700  
2014-04-28 09:15:28 assigned process 928 to cgroup /mnt/cgroups/cpu/user_types/free/tasks  
2014-04-28 09:15:28 using Linux cgroup /mnt/cgroups/cpuacct/users/capsence with mode 700
2014-04-28 09:15:28 assigned process 928 to cgroup /mnt/cgroups/cpuacct/users/capsence/tasks
2014-04-28 09:15:28 using Linux cgroup /mnt/cgroups/memory/user_types/free with mode 700
2014-04-28 09:15:28 assigned process 928 to cgroup /mnt/cgroups/memory/user_types/free/tasks
2014-04-28 09:15:28 uWSGI running as root, you can use --uid/--gid/--chroot options
2014-04-28 09:15:28 chroot() to /mnt/chroots/capsence
2014-04-28 09:15:28 setgid() to 60000
2014-04-28 09:15:28 setuid() to 221465
2014-04-28 09:15:28 limiting number of processes to 4...
2014-04-28 09:15:28 your processes number limit is 4
2014-04-28 09:15:28 your memory page size is 4096 bytes
2014-04-28 09:15:28 detected max file descriptor number: 123456
2014-04-28 09:15:28 building mime-types dictionary from file /etc/mime.types...
2014-04-28 09:15:28 536 entry found
2014-04-28 09:15:28 lock engine: pthread robust mutexes
2014-04-28 09:15:28 thunder lock: disabled (you can enable it with --thunder-lock)
2014-04-28 09:15:28 uwsgi socket 0 bound to UNIX address /var/sockets/capsence.pythonanywhere.com/socket fd 7
2014-04-28 09:15:28 Python version: 2.7.5+ (default, Feb 27     2014, 19:40:54)  [GCC 4.8.1]
2014-04-28 09:15:28 *** Python threads support is disabled. You can enable it with --enable-threads ***
2014-04-28 09:15:28 Python main interpreter initialized at 0x2470a80
2014-04-28 09:15:28 your server socket listen backlog is limited to 100 connections
2014-04-28 09:15:28 your mercy for graceful operations on workers is 60 seconds
2014-04-28 09:15:28 setting request body buffering size to 65536 bytes
2014-04-28 09:15:28 mapped 333936 bytes (326 KB) for 1 cores
2014-04-28 09:15:28 *** Operational MODE: single process ***
2014-04-28 09:15:28 WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x2470a80 pid: 928 (default app)
2014-04-28 09:15:28 *** uWSGI is running in multiple interpreter mode ***
2014-04-28 09:15:28 spawned uWSGI master process (pid: 928)
2014-04-28 09:15:28 spawned uWSGI worker 1 (pid: 929, cores: 1)
2014-04-28 09:15:28 spawned 2 offload threads for uWSGI worker 1
2014-04-28 09:15:30 announcing my loyalty to the Emperor...

Looking at your server logs, the interesting line that stood out for me was:

Tcl_InitNotifier: unable to start notifier thread

It sounds like the app is trying to spawn additional threads, which is currently not permitted on PythonAnywhere. Do you know of a way to configure it not to use threads?

It's quit strange because last week when i tested the application it was working fine, and I have not changed anything...

I'll have a look

Could it be connected with the fact that crm114 is now working?

Sorry, i'm not the original developer of this tool. I'm managing it at the moment... I just can't see how Tcl_InitNotifier is related to the app.
Or is it something from your side.

Well I got it...

I had a logging configuered in settings. When I commented thast out the error was gone.

#LOGGING = {
#    'version': 1,
#    'disable_existing_loggers': False,
#    'handlers': {
#        'mail_admins': {
#            'level': 'ERROR',
#            'class': 'django.utils.log.AdminEmailHandler'
#        }
#    },
#    'loggers': {
#        'django.request': {
#            'handlers': ['mail_admins'],
#            'level': 'ERROR',
#            'propagate': True,
#        },
#    }
#}

#CLASSIFIER_TRAINING_LOG = True

Thank you all is working now.

Excellent, thanks for confirming that! So had the logging settings been changed recently?

No nothing changed for a couple of years actually :)
I had to uncomment the line #CLASSIFIER_TRAINING_LOG = True because we use that to catch the text that is classified. But that is not causing a problem.

Hmmm. The only thing I can think of that might have caused this is a tightening of the number of external processes that your app can start up. Perhaps the logging was somehow running in a different process. That would be weird, but possible... Anyway, we've relaxed the process restrictions now, so it might work again if you re-introduce the logging then reload it. I guess whether you should do that depends on whether you're happy with what you have now and whether you want to risk breaking something that's currently working :-)