Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling location access causes Organic Map to crash (PureOS 10.3) #61

Closed
tristanvigar opened this issue Sep 25, 2023 · 6 comments
Closed

Comments

@tristanvigar
Copy link
Contributor

(Posting as separate issue on @Ferenc- 's recommendation)

Updated to new Organic Maps (Organic Maps 2023.09.22-1-3fc5d2277-dirty-Linux) via Flathub on Librem 5 (PureOS 10/6.3.0-1-librem5) today and Organic Maps crashes after when allowing location access (Location Services is already on via Settings). Launched again using flatpak run app.organicmaps.desktop to try to get more information. This is what I saw:

qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.AccessDenied" "Agent rejected 'app.organicmaps.desktop' for user '1000'. Please ensure that 'app.organicmaps.desktop' has installed a valid app.organicmaps.desktop.desktop file"

Geoclue version: 2.7.0-1pureos1~byz1

Is there anything immediately obvious that I could attempt to troubleshoot with or does this look like a PureOS/Purism issue that I should redirect accordingly? If there is anything I can do to help test, I'm happy to help.

@tristanvigar
Copy link
Contributor Author

tristanvigar commented Sep 25, 2023

geoclue.conf:

# Configuration file for Geoclue
#
# NOTE: All configurations settings below are mandatory and the defaults are
#       what you see before you edit them. If you want to keep the default
#       values around, copy and comment out the appropriate line(s) before
#       changing them.

# Agent configuration options
[agent]

# Whitelist of desktop IDs (without .desktop part) of all agents we recognise,
# separated by a ';'.
whitelist=geoclue-demo-agent;gnome-shell;io.elementary.desktop.agent-geoclue2;sm.puri.Phosh;lipstick

# Network NMEA source configuration options
[network-nmea]

# Fetch location from NMEA sources on local network?
enable=true

# use aa nmea unix socket as the data source
nmea-socket=/var/run/gnss-share.sock

# 3G source configuration options
[3g]

# Enable 3G source
enable=true

# CDMA source configuration options
[cdma]

# Enable CDMA source
enable=true

# Modem GPS source configuration options
[modem-gps]

# Enable Modem-GPS source
enable=false

# WiFi source configuration options
[wifi]

# Enable WiFi source
# If this source and the static source below are both disabled a GeoIP-only
# source will be used instead.
enable=true

# URL to the WiFi geolocation service. If not set, defaults to Mozilla's
# Location Service with a hardcoded key. To use a custom key, uncomment this URL
# while changing YOUR_KEY to your MLS API key.
#url=https://location.services.mozilla.com/v1/geolocate?key=YOUR_KEY

# To use the Google geolocation service instead of Mozilla's, uncomment this URL
# while changing YOUR_KEY to your Google API key.
#
# WARNING: Please make sure that you are complying with the Google's ToS and
#          policies if you uncomment this:
#
# https://developers.google.com/maps/documentation/geolocation/policies
#
#url=https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_KEY

# Submit data to Mozilla Location Service
# If set to true, geoclue will automatically submit network data to Mozilla
# each time it gets a GPS lock.
#
# Currently, only Modem-GPS or Network NMEA sources are supported as providers
# of a location to submit (one at a time).
# If Modem-GPS source is enabled above it will be the exclusive provider
# (regardless whether the system is actually equipped with such modem),
# otherwise Network NMEA source will be considered.
#
submit-data=false

# URL to submission API of Mozilla Location Service. If not set, defaults to
# Mozilla's API with a hardcoded key. To use a custom key, uncomment this URL
# while changing YOUR_KEY to your MLS API key.
#submission-url=https://location.services.mozilla.com/v2/geosubmit?key=YOUR_KEY

# A nickname to submit network data with. A nickname must be 2-32 characters long.
submission-nick=geoclue

# Compass configuration options
[compass]

# Enable Compass
enable=true

# Static source configuration options
#
# This source reads location from "geolocation" file in /etc - please
# consult geoclue(5) man page for the format description of this file.
[static-source]

# Enable the static source
# If you make use of this source, you probably should disable other location
# sources in this file so they won't override the configured static location.
enable=true

# Application configuration options
#
# NOTE: Having an entry here for an application with allowed=true means that
#       geoclue will not ask agent to authorize the application. This is to
#       ensure that applications with built-in authorization mechanism (e.g web
#       browsers) do not have to be bound to agents.
#
#       If your application is denied access to location information and your
#       operating system doesn't provide any mechanism to change that, it is
#       likely a bug in your operation system (or geoclue). The solution is to
#       report the issue with all details, rather than adding your application
#       to this list.
#
# Format:
#
# # Desktop ID of application without .desktop part
# [random-app]
#
# # Allowed access to location information?
# allowed=true|false
#
# # Is application a system component?
# system=true|false
#
# # List of UIDs of all users for which this application is allowed location
# # info access, separate by ';'. Keep it empty for allowing it for all users.
# users=

[gnome-datetime-panel]
allowed=true
system=true
users=

[gnome-color-panel]
allowed=true
system=true
users=

[org.gnome.Shell]
allowed=true
system=true
users=

[io.elementary.desktop.agent-geoclue2]
allowed=true
system=true
users=

[sm.puri.Phosh]
allowed=true
system=true
users=

[epiphany]
allowed=true
system=false
users=

[firefox]
allowed=true
system=false
users=

[lipstick]
allowed=true
system=true
users=

@Ferenc-
Copy link
Collaborator

Ferenc- commented Sep 26, 2023

#0  0x0000fffff610db2c in QObject::property(char const*) const () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#1  0x0000fffff05a8d7c in ?? () from /usr/plugins/position/libqtposition_geoclue2.so
#2  0x0000fffff61146b8 in ?? () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#3  0x0000fffff378df5c in QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher*) () from /usr/lib/aarch64-linux-gnu/libQt6DBus.so.6
#4  0x0000fffff6106bfc in QObject::event(QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#5  0x0000fffff70f6620 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt6Widgets.so.6
#6  0x0000fffff60b8468 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#7  0x0000fffff60bbbd0 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#8  0x0000fffff633bb98 in ?? () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#9  0x0000fffff383923c in g_main_context_dispatch () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#10 0x0000fffff388d4b0 in g_main_context_iterate.constprop () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#11 0x0000fffff38376d4 in g_main_context_iteration () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#12 0x0000fffff633b434 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#13 0x0000fffff60c4224 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#14 0x0000fffff60c0728 in QCoreApplication::exec() () from /usr/lib/aarch64-linux-gnu/libQt6Core.so.6
#15 0x0000aaaaaab6ee14 in main (argc=<optimized out>, argv=<optimized out>) at /run/build/organicmaps/qt/main.cpp:243

@Ferenc-
Copy link
Collaborator

Ferenc- commented Sep 26, 2023

It appears, that Guido from Purism implemented a new geoclue agent here.

Consequences so far:

  1. This actually checks the desktop id and uses that later for authorization purposes. This should be fixed in feat: Add appid patch for Phosh #62 .
  2. There is at least one more mechanism at place which denies geoclue access even if the user clicks on the popup and allows it on an on-demand basis.

A temporary workaround for 2. is appending a new section to the end of geoclue.conf:

[app.organicmaps.desktop]
allowed=true
system=false
users=

@Ferenc-
Copy link
Collaborator

Ferenc- commented Sep 26, 2023

@tristanvigar
Could you remove the stable flatpak and install the one from the PR instead?

flatpak install --user https://dl.flathub.org/build-repo/51463/app.organicmaps.desktop.flatpakref

And then apply the above mentioned geoclue.conf change?

@tristanvigar
Copy link
Contributor Author

tristanvigar commented Sep 26, 2023

Can confirm Organic Maps and Geoclue are working together after installing .flatpakref from #62, adding above entry into geoclue.conf and restarting Geoclue service. Thanks for checking into this!

If a more permanent solution is identified that I can help validate, feel free to reach out. I'd be happy to help.

@Ferenc- Ferenc- pinned this issue Sep 26, 2023
Ferenc- added a commit to Ferenc-/organicmaps that referenced this issue Oct 27, 2023
* Certain GUI Shells like [Phosh](https://en.wikipedia.org/wiki/Phosh)
  implement a `geoclue` agent in which the `desktopId`
  of the application, that requested positioning is checked against the desktop file
  of the same application for authorization purposes.
  See the [location manager of Phosh](
  https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/location-manager.c?ref_type=heads#L239)

* Needed for flathub/app.organicmaps.desktop#61

Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
Ferenc- added a commit to Ferenc-/organicmaps that referenced this issue Oct 31, 2023
* Certain GUI Shells like [Phosh](https://en.wikipedia.org/wiki/Phosh)
  implement a `geoclue` agent in which the `desktopId`
  of the application, that requested positioning is checked against the desktop file
  of the same application for authorization purposes.
  See the [location manager of Phosh](
  https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/location-manager.c?ref_type=heads#L239)

* Needed for flathub/app.organicmaps.desktop#61

Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
biodranik pushed a commit to organicmaps/organicmaps that referenced this issue Nov 1, 2023
* Certain GUI Shells like [Phosh](https://en.wikipedia.org/wiki/Phosh)
  implement a `geoclue` agent in which the `desktopId`
  of the application, that requested positioning is checked against the desktop file
  of the same application for authorization purposes.
  See the [location manager of Phosh](
  https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/location-manager.c?ref_type=heads#L239)

* Needed for flathub/app.organicmaps.desktop#61

Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
@tristanvigar
Copy link
Contributor Author

Latest release is working without any manual interventions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants