doesn't work #6

Closed
opened 2026-10-05 03:07:29 +02:00 by adam · 8 comments
Owner

On a freshly installed debian jessie 8, after building the daemon and configuring the database as instructed, I get the following error:

root@localhost:~/local# srndv2 setup
2015/10/20 19:19:54 Setting up SRNd base...
2015/10/20 19:19:54 checking for configs...
2015/10/20 19:19:54 loading config...
2015/10/20 19:19:54 frontend configured in srnd.ini
2015/10/20 19:19:54 frontend enabled in srnd.ini
2015/10/20 19:19:54 validating configs...
2015/10/20 19:19:54 configs are valid
2015/10/20 19:19:54 connecting to database...
2015/10/20 19:19:54 Connecting to postgres...
2015/10/20 19:19:54 ensure that the database is created...
2015/10/20 19:19:54 cannot create table Newsgroups, pq: Peer authentication failed for user "srnd", login was 'user=srnd password=srnd host=/var/run/postgresql port=5432 client_encoding='UTF8''
root@localhost:~/local# 

I used the recommended default srnd as password and I don't know why table creation fails. When I try to get to the directory as postgres, I get:

cd: /root/local/: Permission denied
or
cd: /root/go/bin/: Permission denied

so I assume I am not supposed to be running srndv2 setup as postgres.

postgres seems to be running:

anon@localhost:~$ ps -A | grep postgres
27934 ?        00:00:00 postgres
27936 ?        00:00:00 postgres
27937 ?        00:00:00 postgres
27938 ?        00:00:00 postgres
27939 ?        00:00:00 postgres
27940 ?        00:00:00 postgres
anon@localhost:~$ 
On a freshly installed debian jessie 8, after building the daemon and configuring the database as instructed, I get the following error: ``` root@localhost:~/local# srndv2 setup 2015/10/20 19:19:54 Setting up SRNd base... 2015/10/20 19:19:54 checking for configs... 2015/10/20 19:19:54 loading config... 2015/10/20 19:19:54 frontend configured in srnd.ini 2015/10/20 19:19:54 frontend enabled in srnd.ini 2015/10/20 19:19:54 validating configs... 2015/10/20 19:19:54 configs are valid 2015/10/20 19:19:54 connecting to database... 2015/10/20 19:19:54 Connecting to postgres... 2015/10/20 19:19:54 ensure that the database is created... 2015/10/20 19:19:54 cannot create table Newsgroups, pq: Peer authentication failed for user "srnd", login was 'user=srnd password=srnd host=/var/run/postgresql port=5432 client_encoding='UTF8'' root@localhost:~/local# ``` I used the recommended default srnd as password and I don't know why table creation fails. When I try to get to the directory as postgres, I get: ``` cd: /root/local/: Permission denied or cd: /root/go/bin/: Permission denied ``` so I assume I am not supposed to be running srndv2 setup as postgres. postgres seems to be running: ``` anon@localhost:~$ ps -A | grep postgres 27934 ? 00:00:00 postgres 27936 ? 00:00:00 postgres 27937 ? 00:00:00 postgres 27938 ? 00:00:00 postgres 27939 ? 00:00:00 postgres 27940 ? 00:00:00 postgres anon@localhost:~$ ``` <!-- github-sync-id:112481582 -->
adam closed this issue 2026-10-05 03:07:29 +02:00
Author
Owner

Looked into logs, found

2015-10-20 19:05:36 EDT [28020-1] srnd@srnd LOG:  provided user name (srnd) and authenticated user name (root) do not match
2015-10-20 19:05:36 EDT [28020-2] srnd@srnd FATAL:  Peer authentication failed for user "srnd"
2015-10-20 19:05:36 EDT [28020-3] srnd@srnd DETAIL:  Connection matched pg_hba.conf line 90: "local   all             all                                     peer"

so it seems I neeeeeed to make a srnd user

useradd srnd
passwd srnd
mkdir /home/srnd/
chown srnd /home/srnd/

srndv2 setup then unsurprising does nothing, not found

okay so

$ go get -u github.com/majestrate/srndv2
sh: 3: go: not found

okay great

$ /home/anon/local/go get -u github.com/majestrate/srndv2
sh: 5: /home/anon/local/go: Permission denied

yeah, probs should've installed go as srnd

root@localhost:/home/srnd# /home/anon/local/go/bin/go get -u github.com/majestrate/srndv2
go: cannot find GOROOT directory: /usr/local/go

there is no /usr/local/go
seems export GOROOT=$HOME/local/go is setting it to /usr/local/go although what it wants is in /home/anon/local/go

so did

anon@localhost:~/local$ tar -C /usr/local/ -xzvf go-stable.tar.gz

I still get error on

root@localhost:/home/anon# /usr/local/go/bin/go get -u github.com/majestrate/srndv2

for whatever reason, seems there is an srndv2 executable in /home/anon/go/bin/ and i am able to change directory into it as srnd

2015/10/20 22:07:47 Setup done

So clean up the setup info it doesn't work for freshly installed debian, just tested.

Looked into logs, found ``` 2015-10-20 19:05:36 EDT [28020-1] srnd@srnd LOG: provided user name (srnd) and authenticated user name (root) do not match 2015-10-20 19:05:36 EDT [28020-2] srnd@srnd FATAL: Peer authentication failed for user "srnd" 2015-10-20 19:05:36 EDT [28020-3] srnd@srnd DETAIL: Connection matched pg_hba.conf line 90: "local all all peer" ``` so it seems I neeeeeed to make a srnd user ``` useradd srnd passwd srnd mkdir /home/srnd/ chown srnd /home/srnd/ ``` srndv2 setup then unsurprising does nothing, not found okay so ``` $ go get -u github.com/majestrate/srndv2 sh: 3: go: not found ``` okay great ``` $ /home/anon/local/go get -u github.com/majestrate/srndv2 sh: 5: /home/anon/local/go: Permission denied ``` yeah, probs should've installed go as srnd ``` root@localhost:/home/srnd# /home/anon/local/go/bin/go get -u github.com/majestrate/srndv2 go: cannot find GOROOT directory: /usr/local/go ``` there is no /usr/local/go seems export GOROOT=$HOME/local/go is setting it to /usr/local/go although what it wants is in /home/anon/local/go so did ``` anon@localhost:~/local$ tar -C /usr/local/ -xzvf go-stable.tar.gz ``` I still get error on ``` root@localhost:/home/anon# /usr/local/go/bin/go get -u github.com/majestrate/srndv2 ``` for whatever reason, seems there is an srndv2 executable in /home/anon/go/bin/ and i am able to change directory into it as srnd ``` 2015/10/20 22:07:47 Setup done ``` So clean up the setup info it doesn't work for freshly installed debian, just tested. <!-- github-comment-id:149749051 -->
Author
Owner

you ran some parts as root that were not supposed to be run as root, trying to figure out which ones.

you ran some parts as root that were not supposed to be run as root, trying to figure out which ones. <!-- github-comment-id:149907627 -->
Author
Owner

kk clarify instructions pls cuz it took me two hours

kk clarify instructions pls cuz it took me two hours <!-- github-comment-id:149907980 -->
Author
Owner

as a rule of thumb, never use root unless you absolutely have to.

as a rule of thumb, never use root unless you absolutely have to. <!-- github-comment-id:149908044 -->
Author
Owner

gee thanks

gee thanks <!-- github-comment-id:149910013 -->
Author
Owner

re-ordering the instructions in build.md tell me if they added clarity to the process.

re-ordering the instructions in build.md tell me if they added clarity to the process. <!-- github-comment-id:149910755 -->
Author
Owner

helps, not much though.

how about suggesting creation of srnd user since the db seems to need same user accessing as what you set, at least mention it there

helps, not much though. how about suggesting creation of srnd user since the db seems to need same user accessing as what you set, at least mention it there <!-- github-comment-id:149914329 -->
Author
Owner

running.md could be changed to

set up the daemon, you'll probably want to do this as the same user as you assigned owner of the database:

srndv2 setup

although I really don't think that's even what you want to do

Most of the stuff not done as root should probably be done as srnd user, database access requires it and for that it seems it needs go set up and configured for srnd user too. That or I suck but I think go needs to be installed and set up as srnd user to work.

running.md could be changed to set up the daemon, you'll probably want to do this as the same user as you assigned owner of the database: ``` srndv2 setup ``` although I really don't think that's even what you want to do Most of the stuff not done as root should probably be done as srnd user, database access requires it and for that it seems it needs go set up and configured for srnd user too. That or I suck but I think go needs to be installed and set up as srnd user to work. <!-- github-comment-id:149918730 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/nntpchan#6