update-sequences.sql giving permission denied when run as root

34 views
Skip to first unread message

Ashim Kapoor

unread,
Mar 9, 2020, 3:09:11 AM3/9/20
to DSpace Technical Support
Dear All,

Here is what I did:

1. I did an AIP backup and restore of a top level community.
2. Looks ok in the browser after restarting tomcat.
3. Then I stopped tomcat and as root did [dspace]/etc/postgresql/update-sequences.sql

It says Permission denied.

I am root, how can I get permission denied? Can some one please help me ?

Thank you,
Ashim

Mark H. Wood

unread,
Mar 9, 2020, 11:20:08 AM3/9/20
to DSpace Technical Support
Because the shell will not execute a command or script which does not
have the executable bit set in its mode, even if you are root.

Also: that is not an executable command or shell script; it is an SQL
script. You need to give it to an SQL interpreter. For PostgreSQL
that would be 'psql'.

The DBMS has its own credentials and permissions, and doesn't give
special powers to 'root'. As any OS user, use the database username
and password that you configured in [dspace]/config/local.cfg when
running 'psql':

psql --user dspace --dbname dspace --file [dspace]/etc/postgres/update-sequences.sql
Password: secret

See

https://wiki.lyrasis.org/display/DSDOC6x/Upgrading+DSpace#UpgradingDSpace-UpgradeSteps

step 11b.

--
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu
signature.asc

Ashim Kapoor

unread,
Mar 11, 2020, 2:25:11 AM3/11/20
to DSpace Technical Support
Dear Mark,

I did this :-

root@DSpace:~# psql --user dspace -d dspace -f /home/dspace/dspace-install/etc/postgres/update-sequences.sql
psql: FATAL:  Peer authentication failed for user "dspace"
root@DSpace:~#

Can you please correct me ?

Thank you,
Ashim


--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/20200309152004.GD20427%40IUPUI.Edu.

Alan Orth

unread,
Mar 11, 2020, 11:23:44 AM3/11/20
to Ashim Kapoor, DSpace Technical Support
Dear Ashim,

"Peer authentication failed" means your PostgreSQL user could not log in. Either the password was wrong, the user doesn't exist, or you have incorrectly configured the "allowed" IPs / databases for that user in pg_hba.conf. On my Ubuntu system the file is here: /etc/postgresql/9.6/main/pg_hba.conf

Are you sure you have a "dspace" user in PostgreSQL? Check the DSpace wiki for more information about the correct settings for pg_hba.conf:


Cheers,



--

Mark H. Wood

unread,
Mar 18, 2020, 2:33:30 PM3/18/20
to DSpace Technical Support
On Wed, Mar 11, 2020 at 11:54:55AM +0530, Ashim Kapoor wrote:
> I did this :-
>
> root@DSpace:~# psql --user dspace -d dspace -f
> /home/dspace/dspace-install/etc/postgres/update-sequences.sql
> psql: FATAL: Peer authentication failed for user "dspace"
> root@DSpace:~#
>
> Can you please correct me ?

This seems to mean that your PostgreSQL is configured to try 'peer'
authentication before password authentication.

https://www.postgresql.org/docs/current/auth-peer.html

You are logged in as 'root' so Pg is looking for an access rule for
the database user 'root', which probably does not exist.

Check pg_hba.conf. You probably want password authentication (md5 or
scram-sha-256) for DSpace itself, regardless of how you authenticate
with 'psql', and it definitely won't work with 'peer' because that
doesn't work on network sockets and the JDBC driver requires them.

https://www.postgresql.org/docs/current/auth-password.html

You may have trouble if you choose the 'scram-sha-256' authentication
method, unless your JDBC driver is quite recent -- for example,
version 42.2.1 works for me. The 'md5' method works with older or
newer drivers.
signature.asc
Reply all
Reply to author
Forward
0 new messages