Rob's picture

Hi,

I just installed TurnKey PostgreSQL 16.1-1 on Proxmox 6.4-4.

I was able to connect to PostgreSQL via PgAdmin from another machine.

I tried to enable the postgis extension but it looked like it was not installed by default.

I then installed postgis via putty and restarted via systemctl.

However the postgis extension did not show up.

ERROR: could not open extension control file "/usr/share/postgresql/11/extension/postgis.control": No such file or directory SQL state: 58P01

I then used the web-admin interface; uninstall then install but postgis still seems to be missing.

Any help would be great.

Willing to test.

Thanks,

Rob

 

 

Forum: 
Rob's picture

Hello again,

The contents of the package called PostGIS looks like PostGIS-utils on other systems e.g. CentOS stream.

So that package has an ESRI shapfile converter and other things. However, the package called PostGIS does not have the atual PostGIS extension for the parent database (PostgreSQL).

The site below has some good instructions

https://computingforgeeks.com/how-to-install-postgis-on-ubuntu-debian/

I think you have to add the PostgreSQL APT repository to the container to get the extension.

The container currently has Postgres 11.12 so the package needed is:

postgresql-11-postgis-3

Willing to test and learn (make and configure LXC for deployment),

Rob

 

Rob's picture

Hi,

Following and slightly modifying the instructions from the site in the previous post I was able to get the extension installed on the container.

Output from SELECT postgis_full_version():

POSTGIS="3.1.2 cbe925d" [EXTENSION] PGSQL="110" GEOS="3.7.1-CAPI-1.11.1 27a5e771" SFCGAL="1.3.6" PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.4.0, released 2018/12/14" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPROTOBUF="1.3.1" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER

 

Not clean. One does end up with a few bogus control files.
-rw-r--r-- 1 root root 175 May 31 09:48 /usr/share/postgresql/11/extension/postgis-3.control
-rw-r--r-- 1 root root 184 May 31 09:48 /usr/share/postgresql/11/extension/postgis_raster-3.control
-rw-r--r-- 1 root root 130 May 31 09:48 /usr/share/postgresql/11/extension/postgis_sfcgal-3.control
-rw-r--r-- 1 root root 204 May 31 09:48 /usr/share/postgresql/11/extension/postgis_tiger_geocoder-3.control
-rw-r--r-- 1 root root 169 May 31 09:48 /usr/share/postgresql/11/extension/postgis_topology-3.control

 

Time to start with a clean container to see if I can reproduce this.

 

Rob


 

Rob's picture

Hi,

Post 2.5 is in the container repos but not installed.

If you want to use post 2.5 you need to install the following:

postgresql-11-postgis-2.5

postgresql-11-postgis-2.5-scripts

Then restart postgresql:

systemctl restart postgresql

If you were connected with pgadmin4 from another machine then:

Disconnect/reconnect and the postgis 2.5 related extensions should show up.

Note, pgrouting is another spatial extension you might want.

If so, install:

postgresql-11-pgrouting

The above package also installs 

postgresql-11-pgrouting-scripts

Again, from pgAdmin 4 disconnect/reconnect

However, the pgrouting extension will not show up in the list until you first install the postgis extension.

Could be a pgAdmin4 thing. CREATE EXTENSION CACADE might work but need to test.

I hope this helps someone,

Rob

 

 

 

 

 

Rob's picture

Hi

If all the packages are installed (container) and the service has been restarted then from pgAdmin4 (5.2)

CREATE EXTENSION pgrouting CASCADE;

works!

(as in the postgis extension is added to the db too)! 

Jeremy Davis's picture

TBH, I actually thought I already had replied (I certainly wrote a reply, but must not have clicked the final "save". Seems likely as I have had a fair bit on lately and have been posting in the forums in the gaps (so getting sidetracked/interupted).

I'm not particularly familiar with PostgreSQL in general or PostGIS specifically. It sounds like you nailed it though. Good work and thanks so much for posting back. Hopefully that will assist others in the future.

Rob's picture

You are welcome and no problem.

I have one more question.

I want to 'reset' the container to 'first boot' mode.

Backup the container and use it as a slightly adjusted container template in Proxmox.

I tried setting RUN_FIRSTBOOT=true (in /etc/default/inithooks.conf) and some stuff happened but it was not the same as when I run turnkey-init.

Any advice?

Rob

Jeremy Davis's picture

turnkey-init is a subset of the full firstboot. Resetting RUN_FIRSTBOOT=true (and ensuring that there is no /etc/inithooks.conf) will do a full rerun through the firstboot scripts - as if it were the firstboot.

If that's not what you experienced, then I'm not sure what is going on?!

Rob's picture

33[K#033[19;9H#033[1K #033[37m#033[47m│#033[0;10m#017#033[30m#033[47m#033[58X#033[19;69H│#033[0;10;1m#017#033[30m#033[40m  #033[36m#033[44m#033[K#033[20;9H#033[1K #033[37m#033[47m│#033[0;10m#017#033[30m#033[47m#033[58X#033[20;69H│#033[0;10;1m#017#033[30m#033[40m  #033[36m#033[44m#033[K#033[21;9H#033[1K #033[37m#033[47m├──────────────────────────────────────────────────────────#033[0;10m#017#033[30m#033[47m┤#033[0;10;1m#017#033[30m#033[40m  #033[36m#033[44m#033[K#033[22;9H#033[1K #033[37m#033[47m│#033[0;10m#017#033[30m#033[47m#033[25X#033[22;36H#033[0;10;1m#017#033[37m#033[44m<#033[33m#033[44m  #033[37m#033[44mO#033[33m#033[44mK  #033[37m#033[44m>#033[0;10m#017#033[30m#033[47m#033[25X#033[22;69H│#033[0;10;1m#017#033[30m#033[40m  #033[36m#033[44m#033[K#033[23;9H#033[1K #033[37m#033[47m└#033[0;10m#017#033[30m#033[47m──────────────────────────────────────────────────────────┘#033[0;10;1m#017#033[30m#033[40m  #033[36m#033[44m#033[K#033[24;11H#033[1K #033[30m#033[40m#033[60X#033[24;72H#033[36m#033[44m#033[K#033[22;39H#033[39;49m#033[m#017#033[2;13H#033[30m#033[47mTraceback (most recent call last):   File#033[3;12H"/usr/lib/inithooks/bin/dialog_wrapper.py", line 75, in#033[4;12Hwrapper     retcode = method("#033[5;12H" + text, *args, **kws)   File#033[6;12H"/usr/lib/python3/dist-packages/dialog.py", line 3116,#033[7;12Hin passwordbox     kwargs, strip_xdialog_newline=True,#033[8;12Hraw_help=True)   File#033[9;12H"/usr/lib/python3/dist-packages/dialog.py", line 1703,#033[10;12Hin _widget_with_string_output     code, output =#033[11;12Hself._perform(args, **kwargs)   File#033[12;12H"/usr/lib/python3/dist-packages/dialog.py", line 1504,#033[13;12Hin _perform     args_file)   File#033[14;12H"/usr/lib/python3/dist-packages/dialog.py", line 1469,#033[15;12Hin _handle_program_exit     child_output_rfd)   File#033[16;12H"/usr/lib/python3/dist-packages/dialog.py", line 1421,#033[17;12Hin _wait_for_program_termination#033[18;12Hchild_output.strip())) dialog.DialogError: dialog-like#033[19;12Hterminated due to an error: the dialog-like program#033[20;12Hexited with status 3 (which was passed to it as the#033[21;12HDIALOG_ERROR environment variable). Sometimes, the#033[22;12Hreason is simply that dialog was given a height or width#033[22;39H#033[39;49m#033[m#017#033[24;71H#033[24;1H#015#033)0#033[1;24r#033[m#017#033[4l#033[?7h#033[39;49m#033[39;49m#033[m#017#033[H#033[J#033[0;10;1m#017#033[36m#033[44m TurnKey #033[37m#033[47m┌────────────────────#033[34m#033[47mCaught exception#033[37m#033[47m──────────────────────#033[0;10m#017#033[30m#033[47m┐#033[0;10;1m#017#033[36m#033[44m#033[K

Jeremy Davis's picture

That looks like the terminal window was resized and when it tried to redraw the dialog, there wasn't enough room (i.e. it was too small).

Rob's picture

I was wondering what the trigger/test is for root logging in for the first time is.

 

If I could reset that somehow, make the system believe root is logging in for the first time then I could try to better isolate the issue with the dialog above.

 

Rob

 

Rob's picture

Hi,

Tried the same process today ... everything works.

I will keep testing to see if it sticks.

Rob

 

Jeremy Davis's picture

Great news! :)

Add new comment