Pengines error: No permission to call sandboxed `'$current_predicate'(_1364,_1366)'

518 views
Skip to first unread message

Eric T

unread,
Jul 17, 2018, 9:04:36 AM7/17/18
to swi-p...@googlegroups.com
In running reactome_notebook locally based on build instructions using 

http://localhost:3050/?code=https://raw.githubusercontent.com/samwalrus/reactome_notebook/master/reactome_pengine.swinb

get the following error


No permission to call sandboxed `'$current_module'(_1432,_1434)' Reachable from: '$syspreds':current_module(A) '$syspreds':generate_current_predicate(A,B,C:D) prolog_listing:current_predicate(A,B:C) prolog_listing:list_module(A,B) prolog_listing:listing_(pengines:A:B,C) prolog_listing:listing(pengines:A:B,C) pengines:listing(A:B) pengines:list_in_module(A,B) pengines:translate_local_source(A,B,C) pengines:translate_local_sources(A,B,C,D)

thought it was something I was doing wrong but then found the thread


Since I am not that familiar with the sandboxing details not sure if this is something I can resolve or it is on the server side?

Update

After reading a bit more my guess is that one or both of these two statements in reactome-pengine/load.pl is the cause of the problem:

:- use_module(pengine_sandbox:reactome_utility_module).
:- use_module(pengine_sandbox:library(semweb/rdf11)).

and that I need to use Predicate safe_meta/2

As I have never done this before, if you don't see a solved response here then I am still working on it / on the wrong track / stuck.

Regards,
Eric




Sam Neaves

unread,
Jul 18, 2018, 3:59:38 AM7/18/18
to Eric T, SWI-Prolog
Hi Eric,

I think this is because you are running a local SWISH that might not have the pengine_rpc/3 predicate enabled as a security precaution. 

Jan has mentioned that this needs to be configured in the linked thread :

" I should have read a little more careful.  This error is because 
the default config denies pengines_rpc/3 as that allows contacting 
other servers in what is potentially an internal network.  This 
restriction can be loaded by the SWISH admin loading the 
library(pengines_sandbox). 

Fabrizio should do that for cplint if he has no objections against 
that. 

Fabrizio: add a file to config_enabled that loads the above library. 
I will add a default file to config-available. 
"

But it is worth backing up and asking is any of this necessary? What exactly are you trying to do with Reactome Pengine? Understand how it works or use the services to access some data?

Sam

On Tue, Jul 17, 2018 at 2:04 PM, Eric T <researc...@gmail.com> wrote:
In running reactome_notebook locally based on build instructions using 

http://localhost:3050/?code=https://raw.githubusercontent.com/samwalrus/reactome_notebook/master/reactome_pengine.swinb

get the following error


No permission to call sandboxed `'$current_module'(_1432,_1434)' Reachable from: '$syspreds':current_module(A) '$syspreds':generate_current_predicate(A,B,C:D) prolog_listing:current_predicate(A,B:C) prolog_listing:list_module(A,B) prolog_listing:listing_(pengines:A:B,C) prolog_listing:listing(pengines:A:B,C) pengines:listing(A:B) pengines:list_in_module(A,B) pengines:translate_local_source(A,B,C) pengines:translate_local_sources(A,B,C,D)

thought it was something I was doing wrong but then found the tread


Since I am not that familiar with the sandboxing details not sure if this is something I can resolve or it is on the server side?

Regards,
Eric




--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Eric

unread,
Jul 18, 2018, 7:43:21 AM7/18/18
to Sam Neaves, swi-p...@googlegroups.com
Hi Sam,

But it is worth backing up and asking is any of this necessary? 
What exactly are you trying to do with Reactome Pengine? 
Understand how it works or use the services to access some data?

For the record for others reading my current threads related to Reactome Pengine be aware that what I am doing is not the intent of why Reactome Pengine was created and should not be done if you don't know why I going off in this tangent direction; so Sam's questions are valid and should be heeded.

What caught my attention with Reactome Pengine was its ability to do queries against a database using Prolog even though the database itself is not based on Prolog and the ability to do federated search. Probably the simplest answer to what I am trying to do with regards to Reactome Pengine is to understand how it works with all of the Prolog libraries such as pengines, rdf, http, etc. and then build upon those concepts to access even more data in other databases and run queries. I don't foresee myself using the SWISH part for what I need in the future, but wouldn't bet against that either. 

Having been around for many decades I know that sometimes people take what you create and then do things with it that you didn't expect, want, desire or invasion, etc., but I have found that is not typically a bad thing and sometimes what people do helps the project to spring board into something greater. 

In creating Reactome Pengine I take it that you learned a lot about SWI-Prolog libraries such as HTTP, RDF, sandbox, etc, and also about what protein data needed to be stored for fast indexing for the queries to run. If you have that in a paper or documented somewhere that would be of value to me, and I am sure of others. Then I would not have to anchor these questions related to Reactome Pengine but could anchor the questions related to that.

In part I am confused in trying to understand how all of these parts work and you are probably as equally confused as to what I am doing, hopefully in the near future the confusion will subside.

I do appreciate your help.

Regards,
Eric







Sam Neaves

unread,
Jul 19, 2018, 5:21:32 AM7/19/18
to Eric, SWI-Prolog
Hi Eric,

That is great, I made reactome pengine mainly as an exemplar service to try and highlight the potential of pengine technology to the life science fields.
As a fan of Prolog I think there are many benefits to be able to use logic to relate the different types of data in this area. 

So the fact that you might also expand and change the ideas is great, I am sure my ideas of how to use the tech are a little different from the original authors.

In regards to making a really simple pengine example you could have one file server.pl

:- use_module(library(pengines)).
:- use_module(library(http/http_unix_daemon)).

animal(walrus).
animal(elephant).
animal(dog).

You can then start this with:

sudo swipl server.pl --user=daemon --port=3500

And the pengine server will be running on localhost port 3500

Then to query it  you would enter a SWI-Prolog session and  load the pengine library for example:

Welcome to SWI-Prolog (threaded, 64 bits, version 7.7.1-23-gc81adf9)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- use_module(library(pengines)).
true.

?- pengine_rpc("http://localhost:3500", animal(X)).
X = walrus ;
X = elephant ;
X = dog.

If you were doing this on a different machine then you would need to change localhost to the ip address of the server. 

In regards to loading data SWI-Prolog has lots of support for RDF and if you look at the reactome pengine code you can see how I loaded in the rdf file and then made the triples availble for the pengine service. 
I don't have much more documentation - but I would highlight the supplementary material for the paper if you did not notice that (attached). 

I also once made a robot that was powered by pengines which was a fun project, it is no longer online  but I did make a video about it: https://www.youtube.com/watch?v=yG1BRMjPgP4 

And yes I certainly did learn a lot, especially from Jan, Markus Triska and Wouter Beek who have the real expertise! 

You might also want to look at the document that Torbjörn has recently shared describing webprolog which he envisions super-seeding the current ideas (I have not fully digested this yet myself).
Here is the link and a discussion: 
https://news.ycombinator.com/item?id=17288493 

Hope this helps,

Sam


bty181_supp.pdf

Eric

unread,
Jul 19, 2018, 7:40:02 AM7/19/18
to Sam Neaves, SWI-Prolog
Hi Sam,

Thanks, looks like we have a common interest as far as being a fan of Prolog and using Prolog to do federated searches related to understanding cellular biology or other topics of interest.

Also thanks for adding a link to the supplementary material and the links to the videos; I have read and watched them before.

As a note for others who may desire to follow in both Sam and my footsteps in understanding all of this is that as Jan noted in an earlier thread is to look at the Docker containers. While I personally have been using VMs such as VMware for decades and WSL I have not really had a need to use Docker until working on this; yes I am from Earth. However much of the specific and working knowledge of these concepts is embedded in the various Docker containers and as shocking as it may seem to some of you just yesterday I learned of two very helpful Docker commands to examine a Docker container, exec with which you can open a bash shell in the running container, and export with which you can export all of the files to a tar file. Here are the Docker containers I have used related to understanding all of this.

ubuntu - This was used with the exec examples

swipl - This runs SWI-Prolog

SWISH - This runs SWISH. Note that SWISH is needed for reactome_notebook but this container does not have the notebook installed.

samneaves/rp4 - This is a Reactome Pengine server which runs reactome-pengine.

If you looking at Docker containers then also look at the associated Dockerfile, this is the name of a file and has no file type, as they have the details of the configuration and build of the Docker image, e.g. SWISH Dockerfile. These can be found in the Docker container.

So Sam, after finding these items and commands I will be busy mining information out of them and hopefully be able to answer most if not all of my questions on my own. For example one question I had with regards to the reactome-pengine files on GitHub was which directory do they go into, the root level, a branch off swipl like swish, the user directory, etc., and after using the Docker export command and looking at the files my question was answered. 

One item of note to not just you but others creating Docker containers is that after I used the Docker exec command to create a bash shell in the running container, I then wanted to do "sudo apt-get install tree" and needed the admin password. As I wasn't able to always guess the password or find the password, if the admin password could it be provided in the documentation for the containers or noted where it is located that would be of help.

Regards,
Eric



Sam Neaves

unread,
Jul 19, 2018, 9:23:41 AM7/19/18
to Eric, SWI-Prolog
Hi Eric,

That is great, I have only really used docker for this as well so I am a long way away from knowing all the tricks but I believe you can log into the container as root by starting the container with the right options:


According to this, you do not need a default password, I am not sure how this actually works with my samneaves/rp4  container though as I have not tested it.

Sam
Reply all
Reply to author
Forward
0 new messages