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

Laverna won't start #913

Open
nachevn opened this issue Feb 12, 2018 · 17 comments
Open

Laverna won't start #913

nachevn opened this issue Feb 12, 2018 · 17 comments

Comments

@nachevn
Copy link

nachevn commented Feb 12, 2018

OS: Arch Linux

Error (see screenshot):
lavernastarterror

@funilrys
Copy link
Contributor

It's been a really long time since I did not review one of my first package in AUR (a lot of bad practices). Let me first invite you to update Laverna if you installed it from AUR.

I just have a new computer and I installed it from AUR and there's no issue ...

@nachevn
Copy link
Author

nachevn commented Feb 13, 2018

Thank you @funilrys for the answer. I tried already to reinstall laverna, unfortunately this didn't help at all. Here is the information regarding the installed version of my machine:

yaourt -Qi laverna
Name            : laverna
Version         : 0.7.51-2
Description     : Laverna is a JavaScript note taking application with Markdown
                  editor and encryption support. Consider it like open source
                  alternative to Evernote.
Architecture    : x86_64
URL             : https://laverna.cc/
Licenses        : MPL2
Groups          : None
Provides        : None
Depends On      : gconf
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 129,14 MiB
Packager        : Unknown Packager
Build Date      : Mo 12 Feb 2018 15:05:23 CET
Install Date    : Mo 12 Feb 2018 15:37:47 CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

If I can help with some other information, please just let know.

@funilrys
Copy link
Contributor

funilrys commented Feb 13, 2018

@nachevn First and before anything you should avoid yaourt. Please use pacaur instead.

Explanation about why you should avoid yaourt: https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table

Actually, the current upstream (AUR) version is 0.7.51-3 ...

@nachevn
Copy link
Author

nachevn commented Feb 13, 2018

Unfortunately same error also with the "newest" version...

pacaur -Qi laverna
Name            : laverna
Version         : 0.7.51-3
Description     : Laverna is a JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote.
Architecture    : x86_64
URL             : https://laverna.cc/
Licenses        : MPL2
Groups          : None
Provides        : None
Depends On      : gconf
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 131,89 MiB
Packager        : Unknown Packager
Build Date      : Di 13 Feb 2018 10:19:33 CET
Install Date    : Di 13 Feb 2018 10:20:52 CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : None

@funilrys
Copy link
Contributor

Can you please copy paste the error so I can take a look at it now that we are in the same version ?

@nachevn
Copy link
Author

nachevn commented Feb 13, 2018

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Error processing argument at index 0, conversion failure from #<Object>
    at validateState (/usr/share/laverna/resources/app/node_modules/electron-window-state/index.js:46:34)
    at module.exports (/usr/share/laverna/resources/app/node_modules/electron-window-state/index.js:154:3)
    at Object.createWindow (/usr/share/laverna/resources/app/electron.js:189:22)
    at Object.onReady (/usr/share/laverna/resources/app/electron.js:147:10)
    at emitTwo (events.js:111:20)
    at App.emit (events.js:191:7)

@funilrys
Copy link
Contributor

@nachevn Did yoou started it from terminal or laverna.desktop ?

Can you give me the terminal output ?

@nachevn
Copy link
Author

nachevn commented Feb 13, 2018

@funilrys There is not really terminal output shown, but in comparison with the laverna.desktop way there is a second exception shown:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: listen EADDRINUSE :::9000
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at Server._listen2 (net.js:1262:14)
    at listen (net.js:1298:10)
    at Server.listen (net.js:1376:9)
    at module.exports (/usr/share/laverna/resources/app/server.js:18:19)
    at Object.startServer (/usr/share/laverna/resources/app/electron.js:154:28)
    at Object.onReady (/usr/share/laverna/resources/app/electron.js:145:10)
    at emitTwo (events.js:111:20)
    at App.emit (events.js:191:7)

After the second dialog is closed, nothing more happend:

$/usr/bin/laverna --dev
Server is running on port: 9000

@funilrys
Copy link
Contributor

funilrys commented Feb 13, 2018

Okay @nachevn I wrote a patch but I can't test so you are going to test it 😄

I created a Gist here

Simply run the following and let's see if it's fixed. If it does fix it I'm going to put the patch into the AUR package and report it into this repository.

# wget https://gist.githubusercontent.com/funilrys/da9a94fe7f28fcbe3e49ff33924db91f/raw/8d0438eb0d524ceb5e0086560e3779523ed5d74c/build_script 
# chmod +x build_script
# ./build_script

@nachevn
Copy link
Author

nachevn commented Feb 13, 2018

@funilrys didn't work. Still the same error

@funilrys
Copy link
Contributor

funilrys commented Feb 13, 2018

@nachevn Updated the patch.

# rm -fr test-laverna-patch build_script
# wget https://gist.githubusercontent.com/funilrys/da9a94fe7f28fcbe3e49ff33924db91f/raw/95ec3541660218b466ebfc14eba31c5abd37c509/build_script
# chmod +x build_script
# ./build_script

@nachevn
Copy link
Author

nachevn commented Feb 14, 2018

@funilrys Thanks, it works. Would you please provide new version in AUR?

funilrys added a commit to funilrys/PKGBUILD that referenced this issue Feb 14, 2018
@funilrys
Copy link
Contributor

Thanks for feedback @nachevn.

Please uninstall Laverna (pacman -Rnsc laverna) and install the new AUR version which provides the patch (pacaur -S laverna).

@funilrys
Copy link
Contributor

funilrys commented Feb 14, 2018

@wwebfor Here's the patch that fixed this.

To apply the following patch please execute

# patch -p0 < pathToThePatch

From the directory which contains electron.js fix this

diff --git electron.js electron.js
index c640036..10a8999 100755
--- electron.js
+++ electron.js
@@ -185,11 +185,13 @@ appHelper = {
      */
     createWindow: function() {

-        // Recover window state (width, height, and x&y position)
-        this.state = windowStateKeeper('main', {
+        // Set window state (width, height, and x&y position)
+        this.state = {
+            x      : 0,
+            y      : 0,
             width  : 1000,
             height : 600
-        });
+        };

         // Create new browser window
         win = new BrowserWindow({
@@ -274,11 +276,6 @@ appHelper = {
      */
     registerEvents: function() {

-        // Save window state (width, height, and x&y position)
-        win.on('close', function() {
-            this.state.saveState(win);
-        }.bind(appHelper));
-
         win.on('closed', function() {
             win = null;
         });

@funilrys
Copy link
Contributor

funilrys commented Aug 8, 2018

Hello there,
Please report to #971 (comment) which explain the state of this project.

For Arch Linux, I think I will create the AUR package once we are fixed with the name of the fork ...

Have a nice day/night,
Cheers,
Nissar

@funilrys
Copy link
Contributor

funilrys commented Aug 8, 2018

@daed if you have time maybe you can implement my patch if it was not already fixed on the dev branch 👍

@daed
Copy link

daed commented Aug 8, 2018

The dev branch doesn't actually contain an electron.js file in it. It either needed to be rewritten, or it's just more evidence that the project was moving singularly toward a client/server model I guess.

I've patched my local copy of master. I'll test it and push it when I get a chance. Realistically, it's going to be a while before dev is in a good state for release, so it may still be valuable to do maintenance for the time being.

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

3 participants