Re: [Spacewalk-list] question regarding spacewalk api channel.software.clone

2018-02-28 Thread Michael Mraka
YANG LI:
> I have a question regarding spacewalk-api channel.software.clone. we are 
> using spacewalk 2.6.
> 
> This is definition of clone method:
> 
> Method: clone
> 
> Description:
> Clone a channel. If arch_label is omitted, the arch label of the original 
> channel will be used. If parent_label is omitted, the clone will be a base 
> channel.
> Parameters:
> string sessionKey
> string original_label
> struct - channel details
> string "name"
> string "label"
> string "summary"
> string "parent_label" - (optional)
> string "arch_label" - (optional)
> string "gpg_key_url" - (optional), gpg_url might be used as well
> string "gpg_key_id" - (optional), gpg_id might be used as well
> string "gpg_key_fp" - (optional), gpg_fingerprint might be used as well
> string "description" - (optional)
> string "checksum" - either sha1 or sha256
> boolean original_state
> Returns:
> 
> int the cloned channel ID
> 
> I do not understand what is original_state? what I suppose to specify when I 
> am calling the method?

Hello YANG,

original_state=true means clone only "original" packages, i.e. packages
not associated with an erratum.
original_state=false means clone all packages, i.e. including packages
associated with an erratum.


Regards,

--
Michael Mráka
System Management Engineering, Red Hat

___
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

Re: [Spacewalk-list] two Maven servers have broken yum

2018-02-28 Thread Michael Mraka
Clouse, Raymond:
> On one of our environments we have two Maven servers (stage & prod) and on 
> both yum seems to have broken:
> 
> $ yum list | grep salt
> Traceback (most recent call last):
>   File "/bin/yum", line 29, in 
> yummain.user_main(sys.argv[1:], exit_code=True)
...
>   File "/usr/lib64/python2.7/site-packages/sqlitecachec.py", line 46, in 
> getPrimary
> self.repoid))
> TypeError: Can not create requiresname index: unable to open database file
> 
> Googling the last line gives me variations on rebuilding the yum database:
> 
> yum clean all
> rm -f /var/lib/rpm/__db*
> rpm --rebuilddb
> 
> But that doesn't fix the problem.
> 
> Perhaps Spacewalk has a separate database for yum and that needs to be 
> rebuilt?  But then why is it just the Maven servers? (the rest of the servers 
> on the environment have no problem, approximately 50 VMs)

Hello Raymond,

Spacewalk does not have a different database. It calls yum/rpm api which
then uses their internal databases. 

You can check if rpm database works, e.g. rpm -qa, rpm -ql kernel.
Then you can try to (backup and) remove yum's cache (/var/cache/yum/*) or
even yum history and package database (/var/lib/yum/*).

> Anyone else seen this kind of issue?

Regards,

--
Michael Mráka
System Management Engineering, Red Hat

___
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

Re: [Spacewalk-list] postgres DB backup question

2018-02-28 Thread Nicole Beck
Thanks everyone. There are a lot of different ways to do it!

The man page for pg_dumpall says "pg_dumpall also dumps global objects that are 
common to all databases. (pg_dump does not save these objects.) This currently 
includes information about database users and groups, tablespaces, and 
properties such as access permissions that apply to databases as a whole."  Is 
that something we have to worry about if we just use the "pg_dump rhnschema" 
method to backup? Spacewalk is the only database I have.


Nicole


From: spacewalk-list-boun...@redhat.com  on 
behalf of Brian Long 
Sent: Tuesday, February 27, 2018 10:49 AM
To: spacewalk-list@redhat.com
Subject: Re: [Spacewalk-list] postgres DB backup question

I use the "db-control" program to handle an online (DB running) backup.
db-control online-backup /local/backups/satellite-pgsql.$DATE 1>/dev/null

/Brian/

On Mon, Feb 26, 2018 at 1:23 PM, Nicole Beck 
mailto:nsky...@syr.edu>> wrote:
Hello!
I’m trying to backup my postgress DB using the Spacewalk install documentation 
at https://github.com/spacewalkproject/spacewalk/wiki/SpacewalkBackup, and it 
fails with the errors below. If I try it without spacewalk running,  it gives 
an error and creates an empty backup file. If I try it with spacewalk running, 
it creates a 3.9 GB backup file, but I can’t restore it. Spacewalk is the only 
thing using this database. How do you all do your database backups?

Errors when spacewalk not running(creates empty backup file):

[root@spacewalk ~]# spacewalk-service stop
Shutting down spacewalk services...
Redirecting to /bin/systemctl stop taskomatic.service
Stopping cobblerd (via systemctl): [  OK  ]
Redirecting to /bin/systemctl stop rhn-search.service
Redirecting to /bin/systemctl stop osa-dispatcher.service
Redirecting to /bin/systemctl stop httpd.service
Redirecting to /bin/systemctl stop tomcat.service
Redirecting to /bin/systemctl stop jabberd.service
Redirecting to /bin/systemctl stop postgresql.service
Done.
[root@spacewalk ~]# su - postgres -c  'pg_dumpall > 
/var/lib/pgsql/backups/full_postgres_backup-`date +%Y%m%d`.sql'
pg_dumpall: could not connect to database "template1": could not connect to 
server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
[root@spacewalk ~]# ls -al /var/lib/pgsql/backups
total 0
drwx-- 2 postgres postgres  47 Feb 26 12:32 .
drwx-- 6 postgres postgres 122 Nov  1 14:55 ..
-rw-r--r-- 1 postgres postgres   0 Feb 26 12:32 
full_postgres_backup-20180226.sql


Errors when spacewalk running

[root@spacewalk ~]# spacewalk-service start
Starting spacewalk services...
Redirecting to /bin/systemctl start
Redirecting to /bin/systemctl start postgresql.service
Redirecting to /bin/systemctl start jabberd.service
Redirecting to /bin/systemctl start tomcat.service
Waiting for tomcat to be ready ...
Redirecting to /bin/systemctl start httpd.service
Redirecting to /bin/systemctl start osa-dispatcher.service
Redirecting to /bin/systemctl start rhn-search.service
Starting cobblerd (via systemctl): [  OK  ]
Redirecting to /bin/systemctl start taskomatic.service
Done.
[root@spacewalk ~]# su - postgres -c  'pg_dumpall > 
/var/lib/pgsql/backups/full_postgres_backup-`date +%Y%m%d`.sql'
pg_dump: [archiver (db)] connection to database "template1" failed: FATAL:  no 
pg_hba.conf entry for host "[local]", user "postgres", database "template1", 
SSL off
pg_dumpall: pg_dump failed on database "template1", exiting
[root@spacewalk backups]# ls -al
total 3910032
drwx-- 2 postgres postgres 47 Feb 26 12:32 .
drwx-- 6 postgres postgres122 Nov  1 14:55 ..
-rw-r--r-- 1 postgres postgres 4003869597 Feb 26 12:40 
full_postgres_backup-20180226.sql

But you can’t restore per the github.com directions:

[root@spacewalk backups]# su - postgres
Last login: Mon Feb 26 12:38:18 EST 2018 on pts/0
-bash-4.2$ SPACEWALK_DB_NAME=spacewalkdb
-bash-4.2$ ls /var/lib/pgsql/backups
full_postgres_backup-20180226.sql
-bash-4.2$ 
SPACEWALK_DB_BACKUPFILE=/var/lib/pgsql/backups/full_postgres_backup-20180226.sql
-bash-4.2$ full_postgres_backup-20180226.sql^C
-bash-4.2$ id
uid=26(postgres) gid=26(postgres) groups=26(postgres)
-bash-4.2$ dropdb $SPACEWALK_DB_NAME
dropdb: could not connect to database template1: could not connect to server: 
No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Thanks!
Nicole


Nicole Beck
Information Technology Analyst
Information Technolgy Services – Core Infrustructure Services - Unix
315.506.9744
nsky...@syr.edu
215 Machinery Hall, Syracuse, NY 13244
syracuse.edu
Syracuse University



___
Spacewalk-list mailing list
Spacewalk-list@r

Re: [Spacewalk-list] postgres DB backup question

2018-02-28 Thread Robert Paschedag
Am 28. Februar 2018 19:15:20 MEZ schrieb Nicole Beck :
>Thanks everyone. There are a lot of different ways to do it!
>
>The man page for pg_dumpall says "pg_dumpall also dumps global objects
>that are common to all databases. (pg_dump does not save these
>objects.) This currently includes information about database users and
>groups, tablespaces, and properties such as access permissions that
>apply to databases as a whole."  Is that something we have to worry
>about if we just use the "pg_dump rhnschema" method to backup?
>Spacewalk is the only database I have.
>
>
>Nicole
>
>
>From: spacewalk-list-boun...@redhat.com
> on behalf of Brian Long
>
>Sent: Tuesday, February 27, 2018 10:49 AM
>To: spacewalk-list@redhat.com
>Subject: Re: [Spacewalk-list] postgres DB backup question
>
>I use the "db-control" program to handle an online (DB running) backup.
>db-control online-backup /local/backups/satellite-pgsql.$DATE
>1>/dev/null
>
>/Brian/
>
>On Mon, Feb 26, 2018 at 1:23 PM, Nicole Beck
>mailto:nsky...@syr.edu>> wrote:
>Hello!
>I’m trying to backup my postgress DB using the Spacewalk install
>documentation at
>https://github.com/spacewalkproject/spacewalk/wiki/SpacewalkBackup, and
>it fails with the errors below. If I try it without spacewalk running, 
>it gives an error and creates an empty backup file. If I try it with
>spacewalk running, it creates a 3.9 GB backup file, but I can’t restore
>it. Spacewalk is the only thing using this database. How do you all do
>your database backups?
>
>Errors when spacewalk not running(creates empty backup file):
>
>[root@spacewalk ~]# spacewalk-service stop
>Shutting down spacewalk services...
>Redirecting to /bin/systemctl stop taskomatic.service
>Stopping cobblerd (via systemctl): [  OK  ]
>Redirecting to /bin/systemctl stop rhn-search.service
>Redirecting to /bin/systemctl stop osa-dispatcher.service
>Redirecting to /bin/systemctl stop httpd.service
>Redirecting to /bin/systemctl stop tomcat.service
>Redirecting to /bin/systemctl stop jabberd.service
>Redirecting to /bin/systemctl stop postgresql.service
>Done.
>[root@spacewalk ~]# su - postgres -c  'pg_dumpall >
>/var/lib/pgsql/backups/full_postgres_backup-`date +%Y%m%d`.sql'
>pg_dumpall: could not connect to database "template1": could not
>connect to server: No such file or directory
>Is the server running locally and accepting
> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
>[root@spacewalk ~]# ls -al /var/lib/pgsql/backups
>total 0
>drwx-- 2 postgres postgres  47 Feb 26 12:32 .
>drwx-- 6 postgres postgres 122 Nov  1 14:55 ..
>-rw-r--r-- 1 postgres postgres   0 Feb 26 12:32
>full_postgres_backup-20180226.sql
>
>
>Errors when spacewalk running
>
>[root@spacewalk ~]# spacewalk-service start
>Starting spacewalk services...
>Redirecting to /bin/systemctl start
>Redirecting to /bin/systemctl start postgresql.service
>Redirecting to /bin/systemctl start jabberd.service
>Redirecting to /bin/systemctl start tomcat.service
>Waiting for tomcat to be ready ...
>Redirecting to /bin/systemctl start httpd.service
>Redirecting to /bin/systemctl start osa-dispatcher.service
>Redirecting to /bin/systemctl start rhn-search.service
>Starting cobblerd (via systemctl): [  OK  ]
>Redirecting to /bin/systemctl start taskomatic.service
>Done.
>[root@spacewalk ~]# su - postgres -c  'pg_dumpall >
>/var/lib/pgsql/backups/full_postgres_backup-`date +%Y%m%d`.sql'
>pg_dump: [archiver (db)] connection to database "template1" failed:
>FATAL:  no pg_hba.conf entry for host "[local]", user "postgres",
>database "template1", SSL off
>pg_dumpall: pg_dump failed on database "template1", exiting
>[root@spacewalk backups]# ls -al
>total 3910032
>drwx-- 2 postgres postgres 47 Feb 26 12:32 .
>drwx-- 6 postgres postgres122 Nov  1 14:55 ..
>-rw-r--r-- 1 postgres postgres 4003869597 Feb 26 12:40
>full_postgres_backup-20180226.sql
>
>But you can’t restore per the github.com directions:
>
>[root@spacewalk backups]# su - postgres
>Last login: Mon Feb 26 12:38:18 EST 2018 on pts/0
>-bash-4.2$ SPACEWALK_DB_NAME=spacewalkdb
>-bash-4.2$ ls /var/lib/pgsql/backups
>full_postgres_backup-20180226.sql
>-bash-4.2$
>SPACEWALK_DB_BACKUPFILE=/var/lib/pgsql/backups/full_postgres_backup-20180226.sql
>-bash-4.2$ full_postgres_backup-20180226.sql^C
>-bash-4.2$ id
>uid=26(postgres) gid=26(postgres) groups=26(postgres)
>-bash-4.2$ dropdb $SPACEWALK_DB_NAME
>dropdb: could not connect to database template1: could not connect to
>server: No such file or directory
>Is the server running locally and accepting
> connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
>
>Thanks!
>Nicole
>
>
>Nicole Beck
>Information Technology Analyst
>Information Technolgy Services – Core Infrustructure Services - Unix
>315.506.9744
>nsky...@syr.edu
>215 Machinery Hall, Syracuse, NY 13244
>syracu