pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.68k stars 414 forks source link

[I] Updating via AppImage does not make the file +x #2342

Closed dmoonfire closed 2 years ago

dmoonfire commented 2 years ago

Expected behaviour

When the application starts and there is an update, there are two options: Update and Just Download (well more, but these are applicable). I'm currently using appimagelauncherd to manage AppImages.

When I pick "Update", it downloads, removes the old one, and puts the new one in place. However, it does not set the executable bit on the download so when the application goes to restart, it cannot start it unless I manually run chmod a+x QOwn*AppImage.

If I use "Just Download", the appimagelauncher integration will pick it up and install it but it does not remove the old one so I ended up with two (or more if I forget to clean up) in the startup menu.

I would prefer to use "Update", but the missing executable bit causes problems.

Actual behaviour

When I use "Update", I expect it to download and then restart into the new version of the AppImage.

Steps to reproduce

  1. Install using appimagelauncher integration.
  2. Start the application with an update pending.
  3. Click "Update".
  4. Click "Restart".

Relevant log output in the Log panel

Expand ``` ```

Information about the application, settings and environment

Expand QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Wed Dec 29 10:22:52 2021` **Version**: `21.12.8` **Build date**: `Dec 29 2021` **Build number**: `930` **Platform**: `linux` **Operating System**: `KDE neon User - Plasma 25th Anniversary Edition` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `AppImage` **Qt Version (build)**: `5.15.2` **Qt Version (runtime)**: `5.15.2` **Portable mode**: `no` **Settings path / key**: `/home/dmoonfire/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/dmoonfire/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `/home/dmoonfire/bin/appimages/QOwnNotes-x86_64_f979fad769f97d1cfd724369c3044853.AppImage` **Qt Debug**: `0` **Locale (system)**: `en_US` **Locale (interface)**: *empty* **Primary screen resolution**: `1920x1080` **Icon theme**: `breeze-dark-qownnotes` **Notes in current note folder**: `169` **Calendar items**: `350` **Enabled scripts**: `2` ## Server Info **serverUrl**: `https://tanxe.typewriter.press` **appIsValid**: `yes` **notesPathExists**: `yes` **serverVersion**: `22.2.0.2` **appVersion**: *empty* ## Spellchecking **Enabled**: `true` **Selected language**: `en_US` **Language codes**: `en_US` **Language names**: `American English (United States)` **Application dictionaries path**: `/home/dmoonfire/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `default` **id**: `1` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/home/dmoonfire/nextcloud/notes` **remotePath**: `notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `yes` **allowDifferentNoteFileName**: `no` **activeNoteSubFolder name**: `Household` **database file**: `/home/dmoonfire/nextcloud/notes/notes.sqlite` ## Cloud connections ### Cloud connection `MASKED` **id**: `1` **isCurrent**: `yes` **serverUrl**: `https://MASKED **username**: `dmoonfire` **accountId**: *empty* ## Enabled scripts ### Script `ATX Headline` **id**: `1` **path**: `/home/dmoonfire/.local/share/PBE/QOwnNotes/scripts/atx-headline/atx-headline.qml` **variablesJson**: *empty* **identifier**: `atx-headline` **version**: `0.0.1` **minAppVersion**: `20.6.0` ### Script `Fix list numbers` **id**: `2` **path**: `/home/dmoonfire/.local/share/PBE/QOwnNotes/scripts/fix-list-numbers/fix-list-numbers.qml` **variablesJson**: *empty* **identifier**: `fix-list-numbers` **version**: `1.0.0` **minAppVersion**: `18.04.3` ## Settings **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-cdbf28fc-1ddc-4d13-bb21-6a4043316a2f` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (QString): `4` **Editor/removeTrailingSpaces** (QString): `false` **Editor/showLineNumbers** (QString): `false` **Editor/useTabIndent** (QString): `false` **Editor/vimMode** (QString): `false` **IssueAssistantDialog/geometry** (QByteArray): `` **LastUpdateCheck** (QDateTime): `2021-12-29T10:17:43.593` **LogWidget/criticalLog** (bool): `true` **LogWidget/debugLog** (bool): `true` **LogWidget/fatalLog** (bool): `true` **LogWidget/infoLog** (bool): `true` **LogWidget/scriptingLog** (bool): `true` **LogWidget/statusLog** (bool): `true` **LogWidget/warningLog** (bool): `true` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (QString): `24` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteTextEdit.code.font** (QString): `Source Code Pro,12,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextEdit.font** (QString): `Source Code Pro,12,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextView.code.font** (QString): `Hack,14,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.font** (QString): `Noto Sans,12,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `true` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (QString): `false` **NoteFolder-1/NoteTabNameList** (QString): `Money` **NoteFolder-1/NoteTabStickinessList**: *empty* **NoteFolder-1/NoteTabSubFolderPathDataList** (QString): `Household` **NoteHistory-1** (QVariantList): `` **NoteHistoryCurrentIndex-1** (QString): `15` **PiwikClientId** (QString): `` **ScriptRepositoryDialog/geometry** (QByteArray): `` **ScriptRepositoryDialog/mainSplitterState** (QByteArray): `` **SearchEngineId** (QString): `2` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShowSystemTray** (QString): `false` **StartHidden** (QString): `false` **UpdateDialog/geometry** (QByteArray): `` **VersionDialog/geometry** (QByteArray): `` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (bool): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `false` **appMetrics/disableTracking** (QString): `false` **appMetrics/notificationShown** (QString): `true` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (bool): `true` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (QString): `` **currentNoteFolderId** (QString): `1` **currentWorkspace** (QString): `initial` **cursorWidth** (QString): `1` **darkMode** (QString): `true` **darkModeColors** (QString): `true` **darkModeIconTheme** (QString): `true` **darkModeTrayIcon** (QString): `true` **defaultNoteFileExtension** (QString): `md` **disableAutomaticUpdateDialog** (QString): `false` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `false` **enableSocketServer** (QString): `true` **enableWebAppSupport** (QString): `false` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `false` **gitCommitInterval** (QString): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (bool): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (QString): `1024` **imageScaleDownMaximumWidth** (QString): `1024` **initialLayoutIdentifier** (QString): `minimal` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (QString): `11` **interfaceLanguage** (QString): *empty* **internalIconTheme** (QString): `false` **itemHeight** (QString): `23` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (QString): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `true` **networking/proxyType** (QString): `2` **newNoteAskHeadline** (QString): `false` **noteEditIsCentralWidget** (QString): `true` **noteFileExtensionList** (QStringList): `md, txt` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (QString): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (QString): `0` **noteSubfoldersPanelShowFullPath** (QString): `false` **noteSubfoldersPanelShowNotesRecursively** (QString): `false` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (QString): `0` **notesPanelOrder** (QString): `0` **notesPanelSort** (QString): `1` **notesPath** (QString): `/home/dmoonfire/nextcloud/notes` **notifyAllExternalModifications** (QString): `false` **overrideInterfaceFontSize** (QString): `false` **ownCloudInfo/appIsValid** (QString): `true` **ownCloudInfo/connectionErrorMessage** (QString): `Unknown error` **ownCloudInfo/notesPathExistsText** (QString): `yes` **ownCloudInfo/serverVersion** (QString): `22.2.0.2` **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **savedSearches/noteFolder-1** (QStringList): `CSharp Libraries, Note 2021-12-03T22.26.38, Note 2021-11-28T00.29.08, Note 2021-11-19T00.50.19, Note 2021-11-18T21.29.53` **showMatches** (QString): `true` **showMenuBar** (bool): `true` **showStatusBar** (bool): `true` **skipVersion** (QString): `21.12.0` **spellCheckLanguage** (QString): `en_US` **systemIconTheme** (QString): `false` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideNoteCount** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (QString): `0` **tagsPanelSort** (QString): `0` **todoCalendarSupport** (QString): `true` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionShow_Todo_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `main toolbar` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `formatting toolbar` **toolbar/3/items** (QStringList): `actionInsert_text_link, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `inserting toolbar` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `encryption toolbar` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `window toolbar` **toolbar/6/items** (QString): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `quit toolbar` **toolbar/size** (QString): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **versionSplitterSizes** (QByteArray): `` **webAppClientService/serverUrl** (QString): `wss://app.qownnotes.org` **webAppClientService/token** (QString): `` **webSocketServerService/bookmarksNoteName** (QString): `Bookmarks` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/commandSnippetsTag** (QString): `commands` **webSocketServerService/port** (QString): `22222` **workspace-initial/name** (QString): `Minimal` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspaces** (QString): `initial` ## System environment **USER**: `dmoonfire` **PAM_KWALLET5_LOGIN**: `/run/user/1000/kwallet5.socket` **LC_TIME**: `en_US.UTF-8` **XDG_SEAT**: `seat0` **XDG_SESSION_TYPE**: `x11` **SSH_AGENT_PID**: `1415` **SHLVL**: `0` **HOME**: `/home/dmoonfire` **DESKTOP_SESSION**: `plasma` **XDG_SEAT_PATH**: `/org/freedesktop/DisplayManager/Seat0` **LC_MONETARY**: `en_US.UTF-8` **NIX_PROFILES**: `/nix/var/nix/profiles/default /home/dmoonfire/.nix-profile` **DBUS_SESSION_BUS_ADDRESS**: `unix:path=/run/user/1000/bus` **LOGNAME**: `dmoonfire` **XDG_SESSION_CLASS**: `user` **XDG_SESSION_ID**: `3` **PATH**: `/home/dmoonfire/.cargo/bin:/home/dmoonfire/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin` **XDG_SESSION_PATH**: `/org/freedesktop/DisplayManager/Session1` **LC_ADDRESS**: `en_US.UTF-8` **XDG_RUNTIME_DIR**: `/run/user/1000` **DISPLAY**: `:0` **LANG**: `en_US.UTF-8` **XDG_CURRENT_DESKTOP**: `KDE` **LC_TELEPHONE**: `en_US.UTF-8` **XDG_SESSION_DESKTOP**: `KDE` **XAUTHORITY**: `/home/dmoonfire/.Xauthority` **SSH_AUTH_SOCK**: `/tmp/ssh-XI7qEzkreDj9/agent.1363` **SHELL**: `/bin/bash` **LC_NAME**: `en_US.UTF-8` **QT_ACCESSIBILITY**: `1` **NIX_SSL_CERT_FILE**: `/etc/ssl/certs/ca-certificates.crt` **LC_MEASUREMENT**: `en_US.UTF-8` **GPG_AGENT_INFO**: `/run/user/1000/gnupg/S.gpg-agent:0:1` **LC_IDENTIFICATION**: `en_US.UTF-8` **XDG_VTNR**: `1` **PWD**: `/home/dmoonfire` **XDG_CONFIG_DIRS**: `/home/dmoonfire/.config/kdedefaults:/etc/xdg/xdg-plasma:/etc/xdg` **XDG_DATA_DIRS**: `/usr/share/plasma:/home/dmoonfire/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop` **LC_NUMERIC**: `en_US.UTF-8` **LC_PAPER**: `en_US.UTF-8` **XCURSOR_THEME**: `breeze_cursors` **XCURSOR_SIZE**: `24` **QT_EXCLUDE_GENERIC_BEARER**: `1` **MOZ_USE_XINPUT2**: `1` **QT_AUTO_SCREEN_SCALE_FACTOR**: `0` **KDE_FULL_SESSION**: `true` **KDE_SESSION_VERSION**: `5` **KDE_SESSION_UID**: `1000` **KDE_APPLICATIONS_AS_SCOPE**: `1` **LOCALE_ARCHIVE_2_27**: `/nix/store/imsdp94kfmdj2hwfgzh0pxxln3nhbm4c-glibc-locales-2.33-56/lib/locale/locale-archive` **IM_CONFIG_PHASE**: `1` **GTK_RC_FILES**: `/etc/gtk/gtkrc:/home/dmoonfire/.gtkrc:/home/dmoonfire/.config/gtkrc` **GTK2_RC_FILES**: `/etc/gtk-2.0/gtkrc:/home/dmoonfire/.gtkrc-2.0:/home/dmoonfire/.config/gtkrc-2.0` **SESSION_MANAGER**: `local/fraxu:@/tmp/.ICE-unix/1517,unix/fraxu:/tmp/.ICE-unix/1517` **DESKTOPINTEGRATION**: `AppImageLauncher` **REDIRECT_APPIMAGE**: `/home/dmoonfire/bin/appimages/QOwnNotes-x86_64_f979fad769f97d1cfd724369c3044853.AppImage` **APPIMAGE**: `/home/dmoonfire/bin/appimages/QOwnNotes-x86_64_f979fad769f97d1cfd724369c3044853.AppImage` **ARGV0**: `/home/dmoonfire/bin/appimages/QOwnNotes-x86_64_f979fad769f97d1cfd724369c3044853.AppImage` **APPDIR**: `/tmp/.mount_QOwnNoSHtF6N` **OWD**: `/home/dmoonfire`
pbek commented 2 years ago

I never had that issue under KDE Neon, I only had it under Manjaro. But I have no idea why, because the AppImage will be made executable in the update process and that process would fail if the "chmod" would fail:

https://github.com/pbek/QOwnNotes/blob/1472ec1f4f2ad5c151276ac7b67ec5bf69d6bc6c/src/dialogs/updatedialog.cpp#L449-L457

My current workaround is to use a snippet that downloads the latest AppImage and sets the permissions (see https://www.qownnotes.org/installation/appimage.html).

pbek commented 2 years ago

Meanwhile you can use these qc command snippets: 😉

## Install latest QOwnNotes AppImage

- <https://github.com/pbek/QOwnNotes/releases>

```bash
curl -L https://api.qownnotes.org/latest_releases/linux | jq .url | xargs curl -Lo /tmp/QOwnNotes && \
sudo mv /tmp/QOwnNotes /usr/local/bin/QOwnNotes && \
sudo chmod a+x /usr/local/bin/QOwnNotes && \
/usr/local/bin/QOwnNotes --version
```

## Install latest qc on Linux

- <https://github.com/qownnotes/qc/releases>
- `qc completion fish > ~/.config/fish/completions/qc.fish` Generate qc fish completion

```bash
curl https://api.github.com/repos/qownnotes/qc/releases/latest | \
jq '.assets[] | select(.browser_download_url | endswith("_linux_amd64.tar.gz")) | .browser_download_url' | \
xargs curl -Lo /tmp/qc.tar.gz && \
tar xfz /tmp/qc.tar.gz -C /tmp && \
rm /tmp/qc.tar.gz && \
sudo mv /tmp/qc /usr/local/bin/qc && \
/usr/local/bin/qc version
```
dmoonfire commented 2 years ago

I wonder if the problem is the appimagelauncherd (AILD) integration. When I run it in a tmp folder (/tmp/qon), it updated and sets the bit. But, when I run it via the integrated version, it doesn't set the flag (plus it uses the previous filename since AILD adds a hash to the end of the file name). So maybe AILD is having a problem because we are messing with it's managed folder.

One reason I'm guessing this is when I say "Run Once" off /tmp/qon, it does set the executable bit (still doesn't restart) in the /tmp/qon version (md5sum says the file has been updated).

pbek commented 2 years ago

On Manjaro I also have the appimage integration, I guess it is also causing the troubles...

pbek commented 2 years ago

22.1.0

pbek commented 2 years ago

This will first trigger in the update from 22.1.0 to 22.1.1, but maybe we can already test in 22.1.0 by faking the old version in the Debug options settings.

pbek commented 2 years ago

There now is a new release, could you please test it and report if it works for you (maybe by faking the old version after the update and doing another update)?

pbek commented 2 years ago

22.1.1 will be released within the next hour. 😉 But you would need to be at 22.1.0 by then to test if the update works correctly...

dmoonfire commented 2 years ago

Thank you. I updated to the latest earlier today so I should be able to test in the morning.

pbek commented 2 years ago

Great! I can at least now update and run the AppImage on Manjaro (when I say "Run once" every time).

dmoonfire commented 2 years ago

This worked beautifully for me, thank you!

pbek commented 2 years ago

Great, thank you for testing! I'll close this then.