# Can't call predicate loaded via src\_text parameter during PEngines ask() call?

**URL:** <https://swi-prolog.discourse.group/t/cant-call-predicate-loaded-via-src-text-parameter-during-pengines-ask-call/765>\
**Category:** Help!\
**Created:** [June 4, 2019, 5:08am UTC](https://swi-prolog.discourse.group/t/cant-call-predicate-loaded-via-src-text-parameter-during-pengines-ask-call/765 "2019-06-04T05:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prodog](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@prodog](https://swi-prolog.discourse.group/u/prodog)\
**Post date:** [June 4, 2019, 5:08am UTC](https://swi-prolog.discourse.group/t/cant-call-predicate-loaded-via-src-text-parameter-during-pengines-ask-call/765/1 "2019-06-04T05:08:01Z")

</div>

I’m using: SWI-Prolog version 8.0.2 on Ubuntu Linux 18.04.

I have now converted my code from being mostly residenton the PEngines server (loaded at server startup), to being passed to the PEngines instance I create via the `src_text` parameter given to the `create()` call. I do not get any errors during the `create()` call. Also, I set the `destroy` option set to **false** in the `create()` call . However, when I try to call one of the predicates found in the code in the `src_text` parameter, I get an _existence error_ back from the PEngines instance.

Here is the module declaration at the top of the code passed via the `src_text` option during the `create()` call:

```prolog
:- module(
	% Module name.
		src_text,
	% Exported predicates list.
		[
			pengine_execute_single_user_action/2,
		]
	).

```

Here is the goal I pass to the PEngines `ask()` method:

```prolog
Attempting Prolog query: pengine_execute_single_user_action(get_player_location(PlayerLocation),QueryReport)

```

Here is the error I receive back from the PEngines instance, as seen from my client Node.JS code:

```prolog
Error: procedure `pengine_execute_single_user_action(A,B)' does not exist
Object received:{
    "arg1": "procedure",
    "arg2": "pengine_execute_single_user_action('$VAR'(0),'$VAR'(1))",
    "code": "existence_error",
    "data": "procedure `pengine_execute_single_user_action(A,B)' does not exist",
    "event": "error",
    "id": "6b057dcc-8ad8-4159-872a-a0c236bb0dca",
    "pengine": {
        "options": {
            "server": "http://localhost:3030/pengine",
            "application": "tsll",
            "destroy": false,
            "src_text": <DELETED TO KEEP THIS POST SHORT>,
            "format": "json"
        },
        "id": "6b057dcc-8ad8-4159-872a-a0c236bb0dca",
        "request": {}
    }
}

```

I tried pre-pending the module name to the goal I pass to the PEngines `ask()` method, but that didn’t work either:

```prolog
Attempting Prolog query: src_text:pengine_execute_single_user_action(get_player_location(PlayerLocation),QueryReport)

```

And now the error changes to this:

```prolog
Error: procedure `src_text:pengine_execute_single_user_action(A,B)' does not exist

```

What am I doing wrong?
