TDE template derived from Person example fails - xquery

I am using MarkLogic 9 and following the tutorial about SQL Datamodeling Guide ( https://docs.marklogic.com/guide/sql/intro ) Al pre conditions are met:
Installing MarkLogic 9 on Cent Os (Done without errors )
Create forests (Done without errors )
Create databases (Done without errors )
Insert data (Done without errors )
Until i reach to create a template view ( https://docs.marklogic.com/guide/sql/setup#id_14127 ) When i execute the statement in the query console i got the following error:
[1.0-ml] SVC-FILOPN: File open error: open '/MarkLogic/tde.xqy': No
such file or directory
Stack Trace
At line 2 column 0:
In xdmp:eval("xquery version "1.0-ml";
import module namespace ...", (), <options xmlns="xdmp:eval"><database>18182129315596444747</database>...</options>)
1. xquery version "1.0-ml";
2. import module namespace tde = "http://marklogic.com/xdmp/tde"
3. at "/MarkLogic/tde.xqy";
The files of MarkLogic are placed in the folder ./opt/MarkLogic and the directory has the folow
erik#marklogic-vm /opt/MarkLogic $ ls -l
total 460
drwxr-xr-x 5 root root 53248 Apr 14 19:40 Admin
drwxr-xr-x 15 root root 4096 Apr 14 19:40 Apps
drwxr-xr-x 4 root root 4096 Apr 14 19:40 Assets
drwxr-xr-x 2 root root 4096 Apr 14 19:40 bin
drwxr-xr-x 3 root root 20480 Apr 14 19:40 Config
drwxr-xr-x 5 root root 4096 Apr 14 19:40 Converters
drwxr-xr-x 2 root root 4096 Apr 14 19:40 Docs
drwxr-xr-x 3 root root 4096 Apr 14 19:40 FlexRep
-rw-r--r-- 1 root root 35147 Apr 11 09:08 GPL.txt
drwxr-xr-x 2 root root 4096 Apr 14 19:40 HealthCheck
drwxr-xr-x 2 root root 4096 Apr 14 19:40 include
drwxr-xr-x 12 root root 4096 Apr 14 19:40 Installer
drwxr-xr-x 3 root root 4096 Apr 14 19:40 java
drwxr-xr-x 2 root root 12288 Apr 14 19:40 Lang
-rw-r--r-- 1 root root 250564 Apr 11 09:08 LEGALNOTICES.txt
-rw-r--r-- 1 root root 18416 Apr 11 09:08 LGPL21.txt
-rw-r--r-- 1 root root 7639 Apr 11 09:08 LGPL30.txt
drwxr-xr-x 2 root root 4096 Apr 14 19:40 lib
drwxr-xr-x 2 root root 4096 Apr 14 19:40 Messages
drwxr-xr-x 7 root root 4096 Apr 14 19:40 mlcmd
drwxr-xr-x 3 root root 4096 Apr 14 19:40 Modules
drwxr-xr-x 2 root root 4096 Apr 11 09:58 Plugins
drwxr-xr-x 8 root root 4096 Apr 14 19:40 Samples
Have you any idea what goes wrong ?
Manny thanks
Erik

Erik - when using the tde:template-insert() function in your Query Console, make sure that you have your 'content' database selected (in your case this would be the SQLData) and not the SQLSchema database. Executing the template-insert() function against the SQLData database will insert the template to the SQLSchema database.
Also, please make sure that your SQLData database has the SQLSchema database associated with it.
We, at MarkLogic, have also just recently released a 4 hour, self-paced course on all new MarkLogic 9 features - including TDE. Please take a look at it - http://www.marklogic.com/training-courses/whats-new-marklogic-9/ - it will definitely help you to get up to speed with the latest additions to the database. (You can also get an assessment done at the end of the course).

Thanks for all the help and reaction. It seems i had previous verion of MarkLogic which TDE is not yet supported. I removed ML comppletly and install ML 9.0 XX
Create one database SQLData and a forest forest-SQL-Data
Set the property triple index at enable
Create one database SQLSchema and a forest SQLSchema
In the query console in the SQLData database in run the folowing query for creating the view:
xquery version "1.0-ml";
import module namespace tde = "http://marklogic.com/xdmp/tde"
at "/MarkLogic/tde.xqy";
let $employees :=
<template xmlns="http://marklogic.com/xdmp/tde">
<context>/Employee</context>
<rows>
<row>
<schema-name>main</schema-name>
<view-name>employees</view-name>
<columns>
<column>
<name>EmployeeID</name>
<scalar-type>int</scalar-type>
<val>ID</val>
</column>
<column>
<name>FirstName</name>
<scalar-type>string</scalar-type>
<val>FirstName</val>
</column>
<column>
<name>LastName</name>
<scalar-type>string</scalar-type>
<val>LastName</val>
</column>
<column>
<name>Position</name>
<scalar-type>string</scalar-type>
<val>Position</val>
</column>
</columns>
</row>
</rows>
</template>
return tde:template-insert("/employees.xml", $employees)
It does not work if you run this in the SQLSchema database.

Related

Using Google CloudBuild to trigger a Firebase deployment, how can I write a static version file?

I have a VueJS app hosted on Firebase, and I'm using CloudBuild to build and deploy it. My ultimate goal is to embed a version number or commit SHA into the footer of the front page, so we can always confirm which version we're seeing in the browser. Happy to hear alternate implementations, but right now I'm just trying to write a static text file.
I know each step in CloudBuild is a unique container, and only /workspace gets held over through each step. If I execute "pwd," I do see that's where all these steps take place.
I can even write the text file as shown (my date interpolation doesn't work), and see the file exists in the subsequent step. But after the final deployment, it's not there.
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args: ['-c', "echo \"$REVISION_ID (commit $COMMIT_SHA) deployed on `date`\" >> ./static/version.txt"]
- name: 'bash'
args: ['ls', '-lart', './static']
# Deploy
- name: 'gcr.io/cloud-builders/npm:node-10.10.0'
args: ['run', 'deploy']
the ls output shows this:
total 56
drwxr-xr-x 2 root root 4096 Apr 17 20:52 svg
drwxr-xr-x 2 root root 4096 Apr 17 20:52 styles
drwxr-xr-x 2 root root 4096 Apr 17 20:52 plugins
-rw-r--r-- 1 root root 442 Apr 17 20:52 manifest.json
drwxr-xr-x 2 root root 4096 Apr 17 20:52 legal
drwxr-xr-x 2 root root 4096 Apr 17 20:52 js
drwxr-xr-x 4 root root 4096 Apr 17 20:52 images
drwxr-xr-x 2 root root 4096 Apr 17 20:52 gifs
drwxr-xr-x 3 root root 4096 Apr 17 20:52 fonts
-rw-r--r-- 1 root root 6148 Apr 17 20:52 .DS_Store
drwxr-xr-x 12 root root 4096 Apr 17 20:59 ..
-rw-r--r-- 1 root root 132 Apr 17 21:00 version.txt
drwxr-xr-x 10 root root 4096 Apr 17 21:00 .
So I know the version.txt file gets written and persists across steps.
The npm run deploy step just runs firebase deploy. The app deploys, but the version.txt file gives a 404. Notably, I can navigate to <APP_ROOT>/static/manifest.json and open that file in the browser -- but since it is part of the git revision, maybe that doesn't tell me much.
Not sure how to proceed from here. Am I missing something about how CloudBuild works? Is there a better way to do this version thing?

dotnet error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/

Steps to reproduce
dotnet build or dotnet run
Expected behavior
Run or Build app
Actual Behavior
Getting ready...
The template "ASP.NET Core with Angular" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/limup/Documents/Projetos/Limup/salao/salao.csproj...
/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' for operations on '/home/limup/Documents/Projetos/Limup/salao/obj/salao.csproj.nuget.cache'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' will allow NuGet to continue. [/home/limup/Documents/Projetos/Limup/salao/salao.csproj]
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
Environment Data
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961
Runtime Environment:
OS Name: fedora
OS Version: 31
OS Platform: Linux
RID: fedora.31-x64
Base Path: /usr/share/dotnet/sdk/3.1.101/
Host (useful for support):
Version: 3.1.1
Commit: a1388f194c
.NET Core SDKs installed:
3.1.101 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Obs
Tried Fixes put in dotnet restore, but I received the same error.
Did not have this problem with dotnet sdk 2.0.
In my case, the problem was caused by ownership of the "lock file" (in Linux).
I was running dotnet build under my user (without sudo) but my project was created using sudo.
Option A)
Use sudo again
sudo dotnet build
Option B)
Change /tmp/NuGetScratch/lock/ ownership:
sudo chown -R <user>:<user> /tmp/NuGetScratch/
Then, the user can run dotnet build without sudo.
I fixed that bug with commands below:
export TMPDIR=/tmp/NuGetScratch/
mkdir -p ${TMPDIR}
but, I've been receive the other error and I opened other question post: Post
I was getting the same error in my Visual Studio 2022 when I was trying to build my new console project.
Severity Code Description Project File Line Suppression State
Error Error occurred while restoring NuGet packages: Unable to obtain
lock file access on for operations on 'NuGet.Config'. This may mean
that a different user or administrator is holding this lock and that
this process does not have permission to access it. If no other
process is currently performing an operation on this file it may mean
that an earlier NuGet process crashed and left an inaccessible lock
file, in this case removing the file will allow NuGet to continue.
The very easy fix you can do is to open your Visual Studio as an administrator and build your project.
#Omair Majid, see:
[limup#localhost tmp]$ ll -a
total 12
drwxrwxrwt. 22 root root 480 Jan 15 16:59 .
dr-xr-xr-x. 18 root root 4096 Jan 10 18:51 ..
drwx------. 2 limup limup 60 Jan 15 16:54 .esd-1000
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .font-unix
drwxrwxrwt. 2 root root 60 Jan 15 16:54 .ICE-unix
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-adb.service-WzMSag
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-chronyd.service-Rw6V8i
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-colord.service-9QFuBh
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-dbus-broker.service-DqpFAf
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-fwupd.service-eBNBLh
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-geoclue.service-O6YLYg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-ModemManager.service-hHCfHf
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-rtkit-daemon.service-3A8e9f
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-switcheroo-control.service-zSjrXg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-systemd-logind.service-ohP23f
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-upower.service-kMAiIg
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-31248c7a-04ad-429c-ab49-4c2ed74a1986
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-8fa994cb-0334-4cf9-886d-103347596108
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .Test-unix
drwx------. 2 limup limup 40 Jan 15 17:00 tracker-extract-files.1000
-r--r--r--. 1 limup limup 11 Jan 15 16:54 .X0-lock
-r--------. 1 gdm gdm 11 Jan 15 16:50 .X1024-lock
drwxrwxrwt. 2 root root 80 Jan 15 16:54 .X11-unix
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .XIM-unix

Qt 5.8: Workaround for QWebEngine not supporting static libraries

I'm trying to deploy an application using Qt 5.8 and need the following libraries:
Qt5Core
Qt5Gui
Qt5Network
Qt5Widgets
Qt5WebEngineCore
Qt5WebEngineWidgets
I originally wanted to create static libraries for all these and use those in my deployment but I read that QWebEngine does not support static libraries.
All I have to work with is the shared libraries.
Example:
$ ls -lrt libQt5WebEngineCore*
-rwxr-xr-x 1 root root 95625576 Jan 18 2017 libQt5WebEngineCore.so.5.8.0
lrwxrwxrwx 1 root root 28 Mar 22 12:38 libQt5WebEngineCore.so -> libQt5WebEngineCore.so.5.8.0
lrwxrwxrwx 1 root root 28 Mar 22 12:38 libQt5WebEngineCore.so.5.8 -> libQt5WebEngineCore.so.5.8.0
lrwxrwxrwx 1 root root 28 Mar 22 12:38 libQt5WebEngineCore.so.5 -> libQt5WebEngineCore.so.5.8.0
-rw-rw-r-- 1 root root 1703 Mar 22 12:38 libQt5WebEngineCore.prl
-rw-rw-r-- 1 root root 1226 Mar 22 12:38 libQt5WebEngineCore.la
Since I can't create a static library for QWebEngine is it ok to tar the shared library files with the -dereference option to preserve the softlinks in order to deploy to the user?

AIX not able to run applications in specific directory

This might be simple problem. But I am stuck with this for weeks now.
We have an AIX server in which we are facing this issue. I am not able to run programs inside a specific directory and its sub directories.
I am getting proper outputs for commands java and scp2 in /opt/FileNet directory. But when I am in /opt/FileNet/RM directory these commands stops working. Outputs are as below.
Java - JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine.
SCP2 - Failed to parse installation path.
I have no idea why this is happening. Your thoughts please.
drwxr-xr-x 24 root system 4096 Feb 21 2012 opt
drwxr-xr-x 17 jxadmin wasadmin 4096 Aug 14 08:40 FileNet
drwxrwxr-x 17 jxadmin wasadmin 4096 Aug 14 08:45 RM
drwxrwxr-x 37 jxadmin wasadmin 4096 Feb 13 2012 AE (/opt/FileNet/AE, This directory is working as expected)
Couldn't find any ACLs.

XCode does not let me change the code

I have been working on a project and since last week xcode does not let me make any changes in my xib file and another page in the project. However I can make changes in other pages. When I open it as root I can make changes in main.xib as well. What can cause this? It is very annoying.
This is what I get:
“MainWindow.xib” is locked for editing and you may not be able to save your changes. Do you want to unlock it?
Sounds like you have lost ownership of your own files (or some reason). You can confirm this from the command line by simply listing them (ls), for example:
$ ls -l
total 184
-rwxr-xr-x 1 andy staff 2731 7 Dec 2010 AppDelegate.h
-rwxr-xr-x 1 andy staff 3976 7 Dec 2010 AppDelegate.m
-rwxr-xr-x 1 andy staff 2625 7 Dec 2010 Choices.h
...
My username is 'andy', so I already own these files, however if I didn't, I could change ownership of the whole directory hierarchy using chown as root:
$ ls -l
total 0
drwxr-xr-x 12 andy staff 408 15 Dec 2010 CFLocalServer
drwxr-xr-x 23 andy staff 782 18 Dec 2010 GridMenu
drwxr-xr-x 12 andy staff 408 16 Dec 2010 Hello
drwxr-xr-x 16 andy staff 544 18 Dec 2010 NSTableViewBinding
drwxr-xr-x 18 andy staff 612 18 Dec 2010 OpenCL_OceanWave
$ sudo chown -R andy:staff *
Password:
$
You can do this using Finder, but that isn't so easy to explain.
Ultimately you need to find out why you lost ownership as currently you are not in control of your own machine, it is in control of you.

Resources