How to attach an .MDF file in a host directory data volume from within Docker mssql-server-linux container? - sql-server

I am mounting a host directory as a data volume with the following:
docker run -v c:\volumes:/var/opt/mssql/data2
-e "ACCEPT_EULA=Y"
-e "SA_PASSWORD=QWEqwe1!"
-e 'MSSQL_PID=Express'
-p 1433:1433
-d microsoft/mssql-server-linux:latest
I created the volume with the instructions in the configuration topic here: https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker#persist.
My host directory contains an .mdf file and an empty .ldf file. When attempting to attach the .mdf file using the following TSQL:
USE [master]
GO
CREATE DATABASE [MY_DATABASE] ON
( FILENAME = N'/var/opt/mssql/data2/MY_DATABASE.mdf' ),
( FILENAME = N'/var/opt/mssql/data2/MY_DATABASE_log.ldf' )
FOR ATTACH
GO
I receive the following ERROR:
"Error: 824, Severity: 24, State: 6.
2018-04-19 19:37:31.29 spid57 SQL Server detected a logical consistency-based I/O error: Insufficient bytes transferred. Common causes are backup configuration, insufficient disk space, or other problems with the storage subsystem such as corruption or hardware failure. Check errorlogs/application-logs for detailed messages and correct error conditions.. It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'C:\var\opt\mssql\data\SS18SV_CORE_log.ldf'. Additional messages in the SQL Server error log or operating system error log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online."
The error.log contains:
"ERROR 5105 A file activation error occurred. The physical file name '\var\opt\mssql\data2\SS18SV_CORE.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
2018-04-19 19:00:14.79 spid54 Error: 824, Severity: 24, State: 6."
Any ideas how I can attach the .mdf file and .ldf file from my data volume successfully?
I am using Docker Community Edition Version 18.03.0-ce-win59 (16762) for Windows. My OS is Windows 10 Enterprise.

Related

Snowsql error in mac OS : Observed error: [Errno 1] Operation not permitted: '/Applications/SnowSQL.app/Contents/snowsql_rt.log_bootstrap'

I am fcing problem while logging to my snoqsql and geting below issue.
when I rung the below line in comand line:
(base) user#MacBook-Air MacOS % snowsql <snoflake ID> -u <user ID>
getting the below response :
We were unable to create or write to the ../snowsql_rt.log_bootstrap. Make sure you have permission to write to the log file's parent folder or to modify the location of the log file specified in the SnowSQL log_file configuration option. See docs: https://docs.snowflake.com/en/user-guide/snowsql-config.html#log-file
Observed error: [Errno 1] Operation not permitted: '/Applications/SnowSQL.app/Contents/snowsql_rt.log_bootstrap'
We were unable to create or write to the ../snowsql_rt.log. Make sure you have permission to write to the log file's parent folder or to modify the location of the log file specified in the SnowSQL log_file configuration option. See docs: https://docs.snowflake.com/en/user-guide/snowsql-config.html#log-file
Observed error: [Errno 1] Operation not permitted: '/Applications/SnowSQL.app/Contents/snowsql_rt.log'
Password:
250001 (n/a): Could not connect to Snowflake backend after 0 attempt(s).Aborting
If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help.
Goodbye!
Shoule be able to login to the Snowflake account

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

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.

Neo4j - Error when having the data folder on external hard drive

I can start Neo4j without issues using default settings.
Now I try to have my Neo4j data in a folder of an external hard drive because I don't have enough space on my local machine for an import.
So in my neo4j.conf I have set: dbms.directories.data=/Volumes/INTENSO/richRich/neo4j-data. Then on neo4j start a databases folder gets created, but the database shuts down immediately after start. This is what I perceived as useful from the debug.log stacktrace:
...
2018-07-22 11:25:55.745+0000 INFO [o.n.k.i.DiagnosticsManager] --- INITIALIZED diagnostics END ---
2018-07-22 11:25:55.912+0000 INFO [o.n.b.BoltKernelExtension] Bolt Server extension loaded.
2018-07-22 11:25:56.069+0000 INFO [o.n.k.i.s.f.RecordFormatSelector] Selected format 'RecordFormat:StandardV3_4[v0.A.9]' for the new store
2018-07-22 11:25:56.118+0000 WARN [o.n.k.NeoStoreDataSource] Exception occurred while setting up store modules. Attempting to close things down. Unable to open store file: /Volumes/INTENSO/richRich/neo4j-data/databases/graph.db/neostore.nodestore.db.labels
org.neo4j.kernel.impl.store.UnderlyingStorageException: Unable to open store file: /Volumes/INTENSO/richRich/neo4j-data/databases/graph.db/neostore.nodestore.db.labels
...
Caused by: org.neo4j.io.pagecache.impl.FileLockException: Already locked: /Volumes/INTENSO/richRich/neo4j-data/databases/graph.db/neostore.nodestore.db.labels
...
I checked /Volumes/INTENSO/richRich/neo4j-data/databases/graph.db/neostore.nodestore.db.labels and the file is there. I also made everything chmod -R 777 to ensure that there are no permission issues.
OS: latest MacOS
Neo4j: 3.4.4 Community Edition

vertica install failing with ssh error

I was trying to install vertica using /opt/vertica/sbin/install_vertica script and following command /opt/vertica/sbin/install_vertica -s vertica001,vertica002,vertica003 -r /root/packages/vertica-6.0.1-7.x86_64.RHEL5.rpm
I was getting following error
Vertica Analytic Database 6.0.1-7 Installation Tool
Starting installation tasks...
Getting system information for cluster (this may take a while)....
'failed to login to 172.16.10.212: EOF ERROR: Could not login with SSH. Here is what SSH said: (publickey,gssapi-keyex,gssapi-with-mic).\r\r\n'
Updating Nodes that are UP
'failed to login to 172.16.10.18: EOF ERROR: Could not login with SSH. Here is what SSH said: (publickey,gssapi-keyex,gssapi-with-mic).\r\r\n'
Updating Nodes that are UP
Removing 172.16.10.212,172.16.10.18 from hosts list
backing up admintools.conf on 172.16.10.52
Info: the package 'pstack' is useful during troubleshooting. Vertica recommends this package is installed.
Checking/fixing OS parameters.....
Error: No JSON object could be decoded
Traceback (most recent call last):
File "/opt/vertica/bin/verticaInstall.py", line 1187, in <module>
if not SSH.check_min_free_kbytes(installerSSH, fix=True):
File "/opt/vertica/oss/python/lib/python2.7/site-packages/vertica/network/SSH.py", line 2388, in check_min_free_kbytes
data =json.loads( ''.join(res[host][1]))
File "/opt/vertica/oss/python/lib/python2.7/json/__init__.py", line 310, in loads
return _default_decoder.decode(s)
File "/opt/vertica/oss/python/lib/python2.7/json/decoder.py", line 346, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/vertica/oss/python/lib/python2.7/json/decoder.py", line 364, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
I have setup passwordless ssh for dbadmin also it has sudo access.
Do I need to have passwordless ssh for root user here ? what I am missing here ?
Do I need to have passwordless ssh for root user here ? what I am missing here ?
Yes. The installer runs on the nodes specified in the host parameter. If SSH is not set up between the nodes, how else is the installer supposed to complete the process? See Configuring the Network and how to Enable Secure Shell (SSH) Logins in the doc.
Q: Why are you installing Vertica 6.0? The latest release is 7.2

The following error occurred while opening the file '\\?\E:\TempDB\MDTempStore_1584_1_j1pv2.tmp': Access is denied

I'm trying to start a fresh install of TFS 2013 but running into the issue TF255356: The following error occurred when configuring the Team Foundation databases: TF400711: Error occurred while executing servicing step Create Warehouse for component InstallWarehouse during Install: Create Analysis Database schema failed: Error generating Analysis Database: File system error: The following error occurred while opening the file '\?\E:\TempDB\MDTempStore_1584_1_j1pv2.tmp': Access is denied.
I have tried to remove the read-only flag from the tempdb folder but it keeps getting set to true after applying the change. I have also added the registry entry UseSystemForSystemFolders which allows read-only to be removed from the folder but it does not persist.
Any help with this would be great
Thanks
Chris

Resources