age icon indicating copy to clipboard operation
age copied to clipboard

ag function does not exist - agtype_volatile_wrapper

Open edinim opened this issue 1 year ago • 4 comments

Describe the bug CREATE and MERGE functions are throwing exceptions.

How are you accessing AGE (Command line, driver, etc.)?

  • DBeaver

What is the command that caused the error?

SELECT * 
FROM cypher('graph_name', $$
    CREATE (n)
$$) as (v agtype);
SQL Error [XX000]: ERROR: ag function does not exist
  Detail: agtype_volatile_wrapper(1)
  Position: 39


Error position: line: 2 pos: 38

Expected behavior A single vertex should be created

Environment (please complete the following information):

  • Age Version: 1.2.0
  • PostgreSQL 11.13 (Debian 11.13-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

Additional context It was working fine, but after the Kubernetes db pod got restarted, these commands started throwing the exception.

edinim avatar May 11 '23 22:05 edinim

Did you check if your AGE extension was properly initialized after Kubernetes db pod restarted ? Enter the following in your psql cli to get list of postgres extensions:

SELECT * FROM pg_extension

If age is enabled, you'll see it in the list of estensions, if not, run:

CREATE EXTENSION age;
LOAD 'age';
SET search_path = ag_catalog, "$user", public;

Try running your query again after running above. Also confirm that DBeaver is correctly connected to your PostgreSQL database and the AGE extension is available in the connected database. Try restarting Dbeaver and refreshing the PostgreSQL server.

safi50 avatar May 12 '23 17:05 safi50

An update: I dropped the age extension and the graphs dropped automatically too, created the extension again and now it working again as before.

Leaving the issue open if anyone has an answer about what may have happened.

@safi50 Thank you for your reply, and yes the extension was enabled and I restarted the db multiple times. Looks like the extension itself crashed.

edinim avatar May 12 '23 18:05 edinim

Sudo make PG_CONFIG=path/to/postgre/bin/pg_config install

after this run postgres run this CREATE EXTENSION age; LOAD 'age'; SET search_path = ag_catalog, "$user", public;

then run SELECT * FROM cypher('graph_name', $$ CREATE (n) $$) as (v agtype);

moiz697 avatar May 17 '23 17:05 moiz697

I believe you are not editing and loading the code correctly. Have a look at this article for detailed guidance Guide to Modifying the Apache Age Source code

humzakt avatar Jun 03 '23 08:06 humzakt