Configuring MSSQL Server on ubuntu - Cannot open or read the persistent registry: \SystemRoot\security.hiv - sql-server

I'm using the following guide to install MSSQL server on my ubuntu 16.04 machine
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017
when I'm running:
sudo /opt/mssql/bin/mssql-conf setup
no matter what kind of SQL Server edition I choose, I'm getting the following error:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
This program has encountered a fatal error and cannot continue running at Mon Apr 1 16:06:07 2019
The following diagnostic information is available:
Reason: 0x00000007
Message: Cannot open or read the persistent registry: \SystemRoot\security.hiv.
Process: 19600 - sqlservr
Thread: 19604 (application thread 0x4)
Instance Id: 7ebfcf27-db60-460d-afd3-6d852b70069e
Crash Id: d99ba388-d323-43f3-b758-e116f42bb2e8
Build stamp: 70437f6583b8ef39b1ef70539ef84690980315dc7a4436c9c40015f28610e4aa
Distribution: Ubuntu 16.04.6 LTS
Processors: 8
Total Memory: 16673366016 bytes
Timestamp: Mon Apr 1 16:06:07 2019
Ubuntu 16.04.6 LTS
Capturing core dump and information to /var/opt/mssql/log...
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
/usr/bin/tail: cannot open '/var/log/syslog' for reading: Permission denied
Attempting to capture a dump with paldumper
Captured a dump with paldumper
Core dump and information are being compressed in the background. When
complete, they can be found in the following location:
/var/opt/mssql/log/core.sqlservr.04_01_2019_16_06_07.19600.tbz2
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG
in /var/opt/mssql/log for more information.
also I found this post, which look like this guy had a similar problem, but sadly no solution
does any one knows how to solve my problem?
Thank you
Edit:
after implementing the answer I got another error:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
Initial setup of Microsoft SQL Server failed. Please consult the ERRORLOG in /var/opt/mssql/log for more information
To make some clean in the mess that I had in the log folder I decided to delete it completely using
sudo rm -rf /var/opt/mssql/log
and re-run the setup, Apparently that solved my last problem and finally:
Setup has completed successfully. SQL Server is now starting.

You'll find further information in
/var/opt/mssql/log
Mine said:
{
"reason": "0x00000007",
"processName": "sqlservr",
"pid": "5773",
"instanceId": "d7df749c-50e6-4f3b-b894-2aa7c743f33d",
"crashId": "281e772a-5946-4349-aa9e-671cd0a3772c",
"threadId": "5777",
"libosThreadId": "0x4",
"buildStamp": "70437f6583b8ef39b1ef70539ef84690980315dc7a4436c9c40015f28610e4aa",
"message": "Cannot open or read the persistent registry: \\SystemRoot\\lsa.hiv.",
"last_errno": "13",
"last_errno_text": "Permission denied",
"distribution": "Ubuntu 16.04.6 LTS",
"processors": "4",
"total_memory": "16732037120",
"timestamp": "Fri Apr 12 22:02:44 2019"
}
So I ran locate to see where "systemroot" is located:
locate security.hiv
/var/opt/mssql/.system/system/security.hiv
I didn't know which permissions should be applied, so I just gave read&write to "others".
then the same with
lsa.hiv
licensing.hiv
re-run
sudo /opt/mssql/bin/mssql-conf setup
and then, sql-server starts, plus the permissions for others are gone again.
By the way, you can run sql-server without service, then it works even if the service fails:
/opt/mssql/bin/sqlservr

In my case (#Mine) it was not only licensing.hiv.
My /var/opt/mssql/.system/instance_id was somehow destroyed and there were more files with owner root.
After deleting /var/opt/mssql/.system/instance_id and changing all root.root files to mssql.mssql (chown mssql.mssql /var/opt/mssql/.system/system/*), I was able to rerun "/opt/mssql/bin/mssql-conf setup"
Afterwards mssql runs fine again
I very goog hint was that "/var/opt/mssql/.system/instance_id" runs on his own.

Related

Unable to install SQL Server (setup.exe)

I used SQL Server 2019 express version on my laptop butI uninstalled. Now I am trying to install SQL Server 2019 Developer edition but I get an error:
Exit code (Decimal): -2068119551 Exit message: Cannot find registry key 'SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState'.
Error description: Invalid command line argument. Consult the windows installer SDK for detailed command line help.
Environment: Dell/Inspiron/Windows 10 Home/16gb ram/256 SSD / 1TB HDD /Corei7
Can anyone help me how to solve the problem? Thanks
PS: attaching screenshot for kind reference
You can try below options, based on the reference article
Run the setup.exe again, repair the installation.
Run the Setup.exe as administrator
See whether you have clearly uninstalled the previous SQL Server setup and try again.
Did you modify the registry setting earlier. If so, please revert the changes and try the installation. Eg., changing the default installation to D:, instead of C: etc.
I fed up the below problem
Unable to install SQL Server (setup.exe).
Exit code (Decimal): -2068119551 Exit message: Cannot find registry key 'SOFTWARE\Microsoft\Microsoft SQL Server\150\ConfigurationState'. Error description: The specified service does not exist as an installed service.
I fixed the above problem
DR-2033 avatar image
Click to vote
1 Vote"
1
DR-2033 answered • Dec 21 2021 at 4:03 AM | EricK-0825 commented • Mar 21 2022 at 3:20 AM
Unable to install SQL Server (setup.exe)

Ubuntu 18.04 issue with xrdp and user

Since morning I am facing some issue with the ubuntu xrdp. I have 3 users server, admin and root. server user is once which is configured during the installation. if is use root user then I am able to login but if I use other server its throw following error.
connecting to sesman ip 127.0.0.1
sesman connect ok
sending login info to session manager, please wait...
login successful for display 10
started connecting
connection problem, giving up
some problem
for admin user its show following error
Unable to determine failsafe session name. Possible causes:
xfconfd isn`t running ( D-Bus setup problem) environment variable $XDG_CONFIG_DIRS is set incorrectly (must include */ etc") or xfce4-session is installed incorrectly.
My Ubuntu version is: Ubuntu 18.04.4 LTS
It`s fresh setup and i also try to reinstall xrdp and its dependency packages but nothing works.
The output of $echo $XDG_CONFIG_DIRS is empty.
After digging in deep and doing lots of troubleshooting, I finally able to access RDP from other users also. I reinstall everything and then install vncserver and kill all the running process of xface from the terminal. Now it's working.

Ubuntu mssql server Corruption detected in persistent registry: \SystemRoot\security.hiv

I started having this issue today on our production sql server. I have tried a variety of different fixes proposed online. We are using MSSQL server 2017 (14.0.3257.3-13). I'm out of ideas on what could be causing the server to crash. Below is the recent crash log.
This program has encountered a fatal error and cannot continue running at Sat Feb 1 14:21:21 2020
The following diagnostic information is available:
Reason: 0x00000007
Status: 0xc000014c
Message: Corruption detected in persistent registry: \SystemRoot\security.hiv.
Stack Trace:
000000006b137250
000000006b1345bf
000000006b1347a3
000000006b1337d3
000000006b1326f2
000000006b175c31
Process: 8815 - sqlservr
Thread: 8819 (application thread 0x4)
Instance Id: e5a2f812-0426-4d92-b9b2-1db1e60d957c
Crash Id: 60073e70-4042-4275-9fcd-a05ae84d26f5
Build stamp: 9726a6583fe7826f57b03fd1c7adf12bebe7692cb64630fccb0541c06820af4d
Distribution: Ubuntu 16.04.6 LTS
Processors: 9
Total Memory: 8589934592 bytes
Timestamp: Sat Feb 1 14:21:21 2020
Last errno: 2
Last errno text: No such file or directory
Thank you for the ideas, Toret.
I have faced the same issue, but I solved it just by deleting the security.hiv file.
rm /var/opt/mssql/.system/system/security.hiv
After that the mssql-server service started normaly.
After working through multiple proposed solutions online nothing worked. Some of the things I tried:
Upgrading mssql-server to latest version.
Repairing missing files or dependencies.
Changing access permissions to the directory.
Elevating access permissions for the mssql user.
Changing user access to root for the .hiv files located in the mssql .system/system folder
The only way to for me to get it to work was to:
Delete all the folders manually from /var/opt/mssql/ except for the
data folder.
Re-link python from 3.5 to 2.7
Then I downgraded the mssql-server version to Microsoft SQL Server 2017 14.0.3192.2.
Run the sudo /opt/mssql/bin/mssql-conf setup
**Python Re-link**
sudo rm /user/bin/python
sudo ln -s /user/bin/python[version] /user/bin/python
After that everything worked again.

Linux MS SQL Server evaluation expired, can't upgrade to developer

When I installed MS SQL Server for Linux half a year ago, there was no way to choose between evaluation and developer. Now the evaluation period has expired and I can't install a developer version. I don't care about any of my databases and I have tried to remove SQL Server before installing it again. The installation is fine but when I run mssql-conf setup I get the following:
Configuring SQL Server...
Error: The evaluation period has expired.
This program has encountered a fatal error and cannot continue running.
The following diagnostic information is available:
Reason: 0x00000001
Signal: SIGSEGV - Segmentation fault (11)
Stacktrace: 0000564434051ee7 00007f9892387b20 00005644340236c2
000056443404a8db 000056443404a059
Process: 7228 - sqlservr
Thread: 7253 (application thread 0x1060)
Instance Id: 357ebf86-214d-4100-b14f-cb62b380917e
Crash Id:
Build stamp: 3db4cdd88f9bbf816f82e0ab6e17825a0a0f8b2ef98a5c67b521be0ed19c297c
/opt/mssql/lib/mssql-conf/invokesqlservr.sh: line 15: 7227 Aborted sudo -EH -u mssql /bin/bash -c "$CMDLINE"
Setup has completed successfully. SQL Server is now starting.
The last line is wrong, SQL Server does not start.
I assume that uninstallation leaves some trace of my old evaluation that is detected when I try to set up the new developer installation. Anyone knows if there is a way to get rid of whatever is blocking the new install?
TIA,
Gunnar
Shane's comment answered the question. Replacing the repository according to https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-suse did the trick!

Moved Oracle 11.2 XE Database Directory, Connected to Idle Instance

So I will start off by stating I have moved the regular install location of Oracle 11.2 XE to a logical volume (/oracle) I had created on my RHEL 6.6 server. After shutting down both the database and the Oracle listener, I performed...
$ cp -R /u01/app/* /oracle
$ rm -rf /u01/app/oracl
$ ln -s /oracle/oracle /u01/app/oracle
Then restarted the listener and the database. Now when I attempt to run the following as the user 'oracle' I get a message...
$ sqlplus
Enter user-name: sys / as sysdba
Enter password: ****
Connected to idle instance.
Further, when I attempt a startup I get an error.
> startup
ORA-45301: XE Edition single instance violation error
I have attempted the solutions found here to no avail.
Here is the output for my listener controller:
bash-4.1$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-MAR-2015 10:26:25
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 10-MAR-2015 10:25:57
Uptime 0 days 0 hr. 0 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dev/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
I'm really quite lost as to what to attempt next. I know I could just reinstall and keep the directory in its proper location but I need it to be in it's own logical volume.
EDIT
Some further information to help clarify my system...
bash-4.1$ env | grep ORA
ORACLE_SID=XE
ORACLE_BASE=/oracle/oracle
ORACLE_HOME=/oracle/oracle/product/11.2.0/xe
bash-4.1$ env | grep TNS
TNS_ADMIN=/oracle/oracle/product/11.2.0/xe/network/admin
bash-4.1$ ps -aux | grep pmon
oracle 2431 0.0 0.2 1265956 16652 ? Ss 11:43 0:00 xe_pmon_XE
FURTHER EDIT
Attempting to sign in to sqlplus using the SYSTEM user returned an error:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
FURTHER EDIT
Output of the ipcs command
bash-4.1$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0xc0a59444 32768 oracle 660 4096 0
------ Semaphore Arrays --------
key semid owner perms nsems
0xd4a9963c 229378 oracle 660 104
0x884d8f34 491523 oracle 660 104
------ Message Queues --------
key msqid owner perms used-bytes messages
Check output of ipcs command and try to delete all shared memory segments/semaphores owned by Oracle.
When Oracle starts it uses two strings ORACLE_SID(uppercase) and ORACLE_HOME, hashes these two strings and uses this hash value a key for shmget call. So even if you append slash / to ORACLE_HOME everything is different from Oracle's perspective - even if the disk path is the same.
So I think you moved ORACLE_HOME into some other location, but the old value was preserved somewhere and now Oracle thinks that you are trying to start multiple instances.
EDITED: I'm not sure about XE, but regular Oracle editions are shipped as a bunch of .o object files. These files are linked during installation, but you can also re-link Oracle anytime. Check the script $ORACLE_HOME/bin/relink if the old ORACLE_HOME is hardcoded in it. And then try to re-link all libraries by executing relink all. Also note that Oracle uses link option -Wl,-rpath=..., so some Oracle binaries have library search patch compiled in them.
For Standard/Enterprise edition it is not problem to copy binaries into different Oracle home.
Check in /u01/app/oracle/product/11.2.0/xe/dbs/ if you have renamed your XE database or attempted to create a new one, you must be sure there is only one database known by xe. It's limited to one instance.
/etc/init.d/oracle-xe stop
cd /u01/app/oracle/product/11.2.0/xe/dbs/
rename any unused pwfile and spfile to .old
/etc/init.d/oracle-xe start
Issue was a wrong entry in tsnnames.ora (I had added a line that shouldn't of been there) and as well the permissions for my /oracle directory were incorrect. Thank you to everyone who tried to help, it was greatly appreciated.

Resources