Facing Error While Reinstalling Apache Age in Ubuntu 22.04

241 Views Asked by At

I was trying to reinstall Apache Age on my Laptop which uses Ubuntu 22.04, the command I used to install Apache Age is

sudo apt install postgresql-12 postgresql-server-dev-12

followed by using the command

make install

But then I face the following error

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -ggdb -Og -fno-omit-frame-pointer -fPIC -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/include/postgresql/server -I/usr/include/postgresql/internal  -D_GNU_SOURCE   -c -o src/backend/catalog/ag_graph.o src/backend/catalog/ag_graph.c
src/backend/catalog/ag_graph.c: In function ‘insert_graph’:
src/backend/catalog/ag_graph.c:67:13: error: void value not ignored as it ought to be
   67 |     graph_oid = CatalogTupleInsert(ag_graph, tuple);
      |               ^
make: *** [<builtin>: src/backend/catalog/ag_graph.o] Error 1

I will be really grateful If you could let me know, how to resolve this, as previously I did not face this issue.

11

There are 11 best solutions below

0
On BEST ANSWER

Do make sure that the related dependencies are installed sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison. Secondly, for some reason I also ran into a similar issue while installing it from APT so I installed postgres directly using the source code.

  • The tar.gz file is what you are looking for.
  • unzip it using tar -xzf filename.tar.gz
  • Before you move forward please make sure you have installed the dependencies above
  • Then cd into the unzipped folder and type ./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"
  • There should be a make file there now. Run make install to lastly install it.

Try that and hopefully it should work.

0
On

For PG13 use the version linked here: https://dist.apache.org/repos/dist/dev/age/PG13/1.3.0.rc0/

The line number 67 that has been referenced in the error is different in the PG13 version than it is in the master branch on github, because the master branch on github is not PG13 compatible.

Line 67 is actually the beginning of this comment.

    /*
     * CatalogTupleInsert() is originally for PostgreSQL's catalog. However,
     * it is used at here for convenience.
     */
    CatalogTupleInsert(ag_graph, tuple);

    table_close(ag_graph, RowExclusiveLock);
}

Try installing for PG13 with the version I linked.

0
On

Make sure the git branch of apacheAGE and the postgres that you have installed are compatible

0
On

You should use PostgreSQL V 11 or 12 to be compatible with Apache AGE.

0
On

You should use the following command before running make:

git checkout PG13

This ensures that you are on the correct branch of Apache AGE for Postgres 13. After that, you can use the following commands:

sudo make PG_CONFIG=/path-to-postgres/data/bin/pg_config
sudo make PG_CONFIG=/path-to-postgres/data/bin/pg_config install

If the errors persists, make sure you have updated your system packages and installed all the libraries that Apache AGE requires by running the following command:

sudo apt update
sudo apt install git libreadline-dev zlib1g-dev bison flex build-essential
0
On

I encountered similar errors. These occur because of version incompatibilities.

Make sure to use the right and compatible versions for all tools.

0
On

First install postgres from git

git clone https://github.com/postgres/postgres.git
git branch -a
git checkout pg12 version

now

 ./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

sudo make -j12 sudo make install -j4

export PATH=/user/local/pgsql/bin:$PATH

now for age

git clone https://github.com/apache/age.git
cd age
sudo make PG_CONFIG=/path/to/pg12/bin/pg_config install
make PG_CONFIG=/path/to/pg12/bin/pg_config installcheck
export PGDATA=/usr/local/pgsql/bin/data
0
On

As per the documentation,

Run the pg_config utility and check the version of PostgreSQL, currently only PostgreSQL versions 11 & 12 are supported. If you have any other version of postgres, you will need to install PostgreSQL version 11 & 12. Follow Setting up multiple versions of PostgreSQL

0
On

At the moment, AGE is fully supported on PG11 and 12 only. Hence it is adviced that you use any of the versions for the installation of AGE.

Switch to the branch of your preferred version:

git checkout PG13
git branch PG12

and try the installation again.

0
On

I suggest you first check your dependencies using

sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison

Then use

git clone https://github.com/apache/age.git

After successful cloning run the following commands

cd age/
git checkout PG12

# install
sudo make PG_CONFIG=/home/username/age_installation/pg/postgresql-12/bin/pg_config install

# install check
make PG_CONFIG=/home/username/age_installation/pg/postgresql-12/bin/pg_config installcheck

For a proper and successful installation all test cases should pass

0
On

There are literally 2 commands to clone Apache-AGE in Ubuntu 22.04.

  1. git clone https://github.com/apache/age.git
  2. cd to clone the directory and run this command sudo make PG_CONFIG=~/postgresql-11.18/bin/pg_config install

Make sure, your system is running proper versions that are compatible with each other while installing.

I hope this answers our question.


Reference => My Blog (Step-by-Step commands)