Resolving Warnings About Previously Used NuoDB IDs

During installation, if you receive one of the following warnings, there are some additional steps you must follow.

********************************************************************
Warning: Unable to use the previous group id used by nuodb and a new
group id has been created. You may need to change group ownership on 
certain files.  Please consult the NuoDB Linux Installation 
documentation for details.
********************************************************************
********************************************************************
Warning: Unable to use the previous user id used by nuodb and a new
user id has been created. You may need to change ownership on 
certain files.  Please consult the NuoDB Linux Installation 
documentation for details.
********************************************************************

This most likely occurred because you had a previous release of NuoDB installed, for which artifacts have remained, and when you installed NuoDB this time, it created a nuodb group and a nuodb user, but could not obtain the same group ID or user ID as it had before. You have two choices:

Deleting the Previous Installation

If you do not care about existing databases, log files, or changes made to /opt/nuodb/etc/default.properties, then uninstall NuoDB and delete all artifacts in NuoDB default directories. This means removing:

Now you can re-install this version of NuoDB and you should not get any warnings or errors.

Repairing User IDs and Group IDs

If you do care about existing databases, log files, and/or changes made to /opt/nuodb/etc/default.properties, then you will have to change group and/or user ownership of existing NuoDB files and directories.

The symptom in this case will be that existing database processes will not start and database requirement will appear not met:

nuodb [domain] > show domain summary
Hosts:
[broker] * localhost/127.0.0.1:48004 (DEFAULT_REGION) CONNECTED
Database: db1

The agent log on your system may have an error similar to the following:

2015-08-27T10:30:26.081-0700 WARNING Enforcer.getLastArchivePeer (descsvc-enfc14-thread-1) 
   Issues found while determining best archive:    
   Archive was not reachable for [Peer null:48004 (local)]: ArchiveHistory not found in: 
      <ArchiveHistory ArchiveFound="false" ResponseId="2">
      <Output>Show archive history failed: Could not find a valid archive at the given location: 
	/var/opt/nuodb/production-archives/db1</Output>  
      </ArchiveHistory>
 
2015-08-27T10:30:26.081-0700 WARNING DescriptionService$DescriptionEnforcer.enforce 
	(descsvc-enfc14-thread-1) Failed to enforce database [db1]: Cannot find last archive. 
			Aborting enforcement
java.io.IOException: Cannot find last archive. Aborting enforcement
        at com.nuodb.impl.util.Preconditions.ioCheckArgument(Preconditions.java:21)
        at com.nuodb.agent.description.Enforcer.getLastArchivePeer(Enforcer.java:352)
        at com.nuodb.agent.description.Enforcer.enforceColdSM(Enforcer.java:257)
        at com.nuodb.agent.description.Enforcer.enforceInternal(Enforcer.java:159)
        at com.nuodb.agent.description.Enforcer.enforce(Enforcer.java:100)
        at com.nuodb.agent.DescriptionContainerImpl.enforce(DescriptionContainerImpl.java:101)
        at com.nuodb.agent.service.DescriptionService.enforceDatabase(DescriptionService.java:696)
        at com.nuodb.agent.service.DescriptionService.access$300(DescriptionService.java:59)
        at com.nuodb.agent.service.DescriptionService$DescriptionEnforcer.enforce(DescriptionService.java:851)
        at com.nuodb.agent.service.DescriptionService$DescriptionEnforcer.run(DescriptionService.java:899)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

If you received the installation warning about user ID, that is, Unable to use the previous user id used by nuodb, then you will need to change ownership (chown) of the files and directories.

If you received the installation warning about group ID, that is, Unable to use the previous group id used by nuodb, then you will have to change the group (chgrp) of the files and directories.

If you received both, you will need to execute both chown and chgrp.

Run the following commands:

# Change owner to nuodb
$ sudo chown -R nuodb /opt/nuodb
$ sudo chown -R nuodb /var/opt/nuodb
$ sudo chown -R nuodb /var/log/nuodb
$ sudo chown -R nuodb /etc/nuodb

# Change group to nuodb
$ sudo chgrp -R nuodb /opt/nuodb
$ sudo chgrp -R nuodb /var/opt/nuodb
$ sudo chgrp -R nuodb /var/log/nuodb
$ sudo chgrp -R nuodb /etc/nuodb

If you chose a non-default location for your archive and journal directories, you must run the same commands on those directories.

Now the database processes will automatically start and your database requirements will be met.