Settings schema 'com.github.Suzie97.epoch' is not installed - settings

This is the gschema.xml code for my app:
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/com/github/Suzie97/epoch"
id="com.github.Suzie97.epoch"
gettext-domain - "com.github.Suzie97.epoch">
<key name="pos-x" type="i">
<default>360</default>
<summary>Most recent x position of Epoch</summary>
<description>Most recent x position of Epoch</description>
</key>
<key name="pos-y" type="i">
<default>360</default>
<summary>Most recent y position of Epoch</summary>
<description>Most recent y position of Epoch</description>
</key>
</schema>
</schemalist>
This is the meson.build file to install the gschema:
install_data(
'gschema.xml',
install_dir: join_paths (get_option ('datadir'), 'glib-2.0', 'schemas'),
rename: meson.project_name() + '.gschema.xml'
)
When I compile this error is displayed:
Settings schema 'com.github.Suzie97.epoch' is not installed
This is the post_install.py script:
#!/usr/bin/env python3
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
schemadir = os.path.join(install_prefix, 'share/glib-2.0/schemas')
if not os.environ.get('DESTDIR'):
print('Compiling the gsettings schemas ... ')
subprocess.call(['glib-compile-schemas', schemadir])
Why is this happening?

There are various issues at play:
the name of the schema file should match your application's identifier—in this case, it would be com.github.Suzie97.epoch.gschema.xml
you should not rename the file on installation; just installing it under the glib-2.0/schemas data directory is enough
you should call glib-compile-schemas $datadir/glib-2.0/schemas to "compile" all the schemas once you installed your application; this is typically done as a post-installation script in Meson, using meson.add_install_script().
GSettings does not use the XML per se: the glib-compile-schemas tool will generate a cache file that will be shared by all applications using GSettings, and will be fast to load. This is why GSettings will warn you that the schema is not installed: you are missing that last compilation step.

Related

Why do I get "Error: '.', hexadecimal value 0x00, is an invalid character. Line 2, position 1." from xsd utility

I want to be able to scan SSRS report definition (.rdl) files and alter them programmatically. I am following a Microsoft tutorial (albeit a little out-of-date but can't find an up-to-date version).
The tutorial is here: https://learn.microsoft.com/en-us/previous-versions/sql/sql-server-2005/aa337455(v%3dsql.90)
I have downloaded the XML Schema File from the Microsoft website - ReportDefinition.xsd - and am now following the steps 4 to 6 that say to open the Visual Studio Command Prompt and run the utility XSD to generate the ReportDefinition.vb file that contains the classes for the RDL schema.
However, when I run the command as per the instructions:
xsd /c /l:VB /n:SampleRDLSchema ReportDefinition.xsd
... I simply get the error message:
Error: '.', hexadecimal value 0x00, is an invalid character. Line 2, position 1.
This is the first few lines of the file; I can't see the characters 0x00 the error message refers to:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All rights reserved. -->
<xsd:schema targetNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition"
elementFormDefault="qualified">
<xsd:annotation>
<xsd:documentation>
The following schema describes the structure of the
Report Definition Language (RDL) for Microsoft SQL Server 2008 R2.
Given this is a Microsoft written set of instructions to use a Microsoft utility running against a Microsoft supplied file, I'm a bit baffled as to why there should be an error in it.
Can anyone help? Thanks.
The issue being reported at the start of line 2 could indicate that this is an encoding issue. The attribute encoding="utf-8" on the first line indicates that the file should be interpreted as having a a UTF-8 encoding. So after the first line, the xsd utitlity would try to read the file as UTF-8. If the file actually uses a different encoding, then an error would be produced like the one you have encountered.
To test this, remove encoding="utf-8" from the first line & run the command again.
For me, it was another issue. My file contained some includes like :
<xs:include schemaLocation="XMLFILE.xsd"/>
So the error meaning is "it cannot find the XMLFILE.xsd". Make sure you have all related xml files from all includes in all files. You know it when you right clicking on the file in visual studio and do "View Code (F7)". If the include is underlined in red, the file is missing or something in the "XMLFile.xsd" is missing.
Please Microsoft's crew, showing a clear error message can save us a ton of hours of works... Don't you?

Sparkle - sign_update via ssh: "Unable to access required key in the Keychain"?

Sparkle-1.21.0
OS X 10.11
generate_appcast doesn't work with .dmg file:
Error generating appcast from directory
/Users/quanta/Downloads/updates Error Domain=SUSparkleErrorDomain
Code=1001 "No usable archives found in
/Users/quanta/Downloads/updates" UserInfo={NSLocalizedDescription=No
usable archives found in /Users/quanta/Downloads/updates}
So, I have to create appcast.xml manually:
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>x</title>
<item>
<title>1.0.0.2891</title>
<pubDate>Thu, 06 Dec 2018 17:25:26 +0800</pubDate>
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<enclosure url="https://example.com/x.dmg" sparkle:version="1.0.0.2891" sparkle:shortVersionString="1.0.0.2891" length="86454539" type="application/octet-stream"/>
</item>
</channel>
</rss>
Got this error when testing:
DSA signature validation of the package failed. The update contains an installer package, and valid DSA signatures are mandatory for all installer packages. The update will be rejected. Sign the installer with a valid DSA key or use an .app bundle update instead.
First time running sign_update, I choose "Always allow", so it does not ask for password in the next time:
$./bin/sign_update /path/to/x.dmg
sparkle:edSignature="x==" length="105562628"
But I still got this error when running via ssh:
$ ~/Downloads/Sparkle-1.21.0/bin/sign_update /path/to/x.dmg
ERROR! Unable to access required key in the Keychain -25308 (you can look it up at osstatus.com)
I know that we can use openssl to do the same thing: https://github.com/sparkle-project/Sparkle/blob/master/bin/old_dsa_scripts/sign_update
but how can I export dsa_priv.pem from my keychain?
The reason is login.keychain is locked when running via ssh.
We have to unlock it before running sign_update. Put the following command into a script:
#!/bin/sh
security unlock-keychain -p "$pa55w0rd" $HOME/Library/Keychains/login.keychain

umap collectstatic gives "No such file or directory" error

As I have very little knowledge about Linux, pretty much all I can do is copy and paste things from a good tutorial and in most cases simply hope nothing goes wrong. I really tried finding a solution on my own and searching the internet but to no avail (I found a number of quite similar things but no solution I understood enough to be able to adapt it on my own to fix my problem).
I've installed an osm tile server using this amazing tutorial and it works like a charm. Now I want to install umap, using this tutorial.
Everything works fine until I get to the line "umap collectstatic". The error I get is this:
(venv) $ sudo umap collectstatic
[sudo] Passwort für umap2:
You have requested to collect static files at the destination
location as specified in your settings:
/home/ybon/.virtualenvs/umap/var/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "/usr/local/bin/umap", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/umap/bin/__init__.py", line 12, in main
management.execute_from_command_line()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, in handle
collected = self.collect()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 115, in collect
for path, storage in finder.list(self.ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/finders.py", line 112, in list
for path in utils.get_files(storage, ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
directories, files = storage.listdir(location)
File "/usr/local/lib/python2.7/dist-packages/django/core/files/storage.py", line 399, in listdir
for entry in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/home/ybon/Code/js/Leaflet.Storage'
Now, I get the something might be wrong with a setting in a config file somewhere, but changing the directory in local.py
doesn't seem to do anything (like I have set it to STATIC_ROOT = '/home/xxx_myusername_xxx/umap/var/static') - I have no idea where this "/home/ybon/Code/..." path even comes from! What settings ?
I sure didn't specify THIS path anywhere! And the folder is indeed nowhere to be found on my machine. Maybe using virtualenv is somehow generating it, and I can't find it on my machine because it IS virtual (as in "not really there physically") but this is just a very wild guess and I don't really know what I'm talking about.
(I tried running the command with and without sudo and it doesn't change anything).
I have always wanted to install a tile server and have tried the tutorials you have given today. So I'm a learner like you!
Installing the Tile Server with the tutorial https://www.linuxbabe.com/linux-server/openstreetmap-tile-server-ubuntu-16-04 was really straightforward. I only used the part for Rhineland Palatinate.
With Umap (https://umap-project.readthedocs.io/en/latest/ubuntu/#tutorial) I had some problems.
1. A port was used twice. I changed the port for Apache.
2. After creating the local configuration (wget https://raw.githubusercontent.com/umap-project/umap/master/umap/settings/local.py.sample -O /etc/umap/umap.conf) this file was not immediately recognized. I helped myself by changing the file before executing the command "umap migrate".
I have made the following changes:
# For static deployment
STATIC_ROOT = '/etc/umap/var/static'
# For users' statics (geojson mainly)
MEDIA_ROOT = '/etc/umap/umap/var/data'
# Umap Settings
UMAP_SETTINGS='/etc/umap/umap.conf'
STATIC_ROOT und MEDIA_ROOT I have changed, because so the user umap has all permissions. Then I set the envirement variable UMAP_SETTINGS because otherwise the settings file /etc/umap/umap.conf is not found.
( I also have no idea where this "/home/ybon/Code/..." path comes from. After the configuration file is properly loaded, the path is loaded from the configuration file. That's why that's not important anymore. )
Now I could use the following commands without errors:
(venv) $ umap collectstatic
Loaded local config from /etc/umap/umap.conf
You have requested to collect static files at the destination
location as specified in your settings:
/etc/umap/var/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Copying '/srv/umap/venv/lib/python3.5/site-packages/umap/static/favicon.ico'
...
290 static files copied to '/etc/umap/var/static'.
(venv) $ umap storagei18n
Loaded local config from /etc/umap/umap.conf
Processing English
Found file /etc/umap/var/static/storage/src/locale/en.json
Exporting to /etc/umap/var/static/storage/src/locale/en.js
..
Processing Deutsch
Found file /etc/umap/var/static/storage/src/locale/de.json
..
Found file /etc/umap/var/static/storage/src/locale/sk_SK.json
Exporting to /etc/umap/var/static/storage/src/locale/sk_SK.js
(venv) $ umap createsuperuser
Loaded local config from /etc/umap/umap.conf
Username (leave blank to use 'umap'):
Email address:
Password:
Password (again):
Superuser created successfully.
(venv) $ umap runserver 0.0.0.0:8000
Loaded local config from /etc/umap/umap.conf
Loaded local config from /etc/umap/umap.conf
Performing system checks...
System check identified no issues (0 silenced).
April 09, 2018 - 14:02:15
Django version 1.10.5, using settings 'umap.settings'
Starting development server at http://0.0.0.0:8000/
And finally I was able to use umap.

Why does my ATG build fail when using runAssembler?

I recently installed ATG 10.2 on my Mac using the instructions found here.
After successfully installing ATG I then tried to compile my ATG code using the runAssembler script provided, however I encountered the following error:
[ERROR] ./bin/dynamoEnv.sh: line 355: -Djava.security.policy=lib/java.policy: No such file or directory
Why does my ATG build fail?
In the spirit of SO I am answering my own question:
It turns out I encountered a known bug with the ATG installers which fail to update the <DYNAMO_HOME>/home/localconfig/dasEnv.sh with the correct values (dasEnv.bat for Windows). The values which you need to add to this file are:
# Note: I am using WebLogic (change if you are using jBoss or WebSpere)
export ATGJRE=<YOUR_PATH_TO_JAVA>
# e.g. export ATGJRE=/usr/bin/java
export WL_HOME=<WLS_HOME>
# e.g. export WL_HOME=/Users/my_user/Applications/weblogic/wlserver10_3
export WL_VERSION=10.3.6
# self explanatory ...
Please note that this bug affects Windows installs too. More information can be found here.

CREATE DATABASE fails using VSDBCMD

When trying to deploy a VS2010 database project using the VSDBCMD tool, I get the following error:
SQL01268 .Net SqlClient Data Provider: Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "D:\MSSQL10_50\MSSQL10_50.MSSQLSERVER\MSSQL\Data\Data.mdf" failed with the operating system error 21(failed to retrieve text for this error. Reason: 1815).
SQL01268 .Net SqlClient Data Provider: Msg 1802, Level 16, State 1, Line 1 CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
However, if I take the SQL script generated by VSDBCMD and run it in SQL Management Studio, it works fine. Similarly, I can create the DB manually in Mgt Studio.
'Operating system error 21' is apparently Device Not Ready, but this looks spurious to me... The folder paths are all correct, and unlocking the security on the folders doesn't fix the issue (e.g. 'everyone' > full control). Also, there are no errors in the SQL log or event viewer on the server.
What is different between running VSDBCMD on the command line, and running the same SQL script through Management Studio??
Any ideas very welcome!
Chris
As per my own comments, this error was because the drive didn't actually exist.
If you are creating database with vsdbcmd in a server based on a dbschema, it would be nice to set path location for data and log files.
To change log path location in your .dbschema file:
<Element Type="ISql90File" Name="[YOUR_DATABASE_NAME_Data]">
<Property Name="FileName" Value="E:\YOUR DATA FOLDER\$(DatabaseName)_Data.MDF" />
<Element Type="ISql90File" Name="[YOUR_DATABASE_NAME_Log]">
<Property Name="FileName" Value="E:\YOUR LOGS FOLDER\$(DatabaseName)_Log.LDF" />
then import it into Sql Server using Command prompt:
CD\
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Deploy\vsdbcmd.exe" /a:Deploy
/cs:"Server=YOUR_SERVER\YOUR_INSTANCE;User Id=YOUR_USER;Password=YOUR_PASS;Pooling=false"
/dsp:Sql /dd+ /model:"C:\FOLDER\YOUR_DBSCHEMA_FILE.dbschema"
/p:TargetDatabase="YOUR_DATABASE_NAME"
More info on vsdbcmd: http://msdn.microsoft.com/en-us/library/dd193283.aspx

Resources