Closed rayx closed 5 years ago
Hi @rayx, that is looking good so far. In addition to using lein run
or starting the binary as you did, you need to run npm start
from the project root.
The packaged version that you can create with make release
would start the Java process in the background for you. That command would fail for you without my GH_TOKEN
in the environment, but it would still create the packaged version in ./dist
. Please let me know if this helps.
Hi @rayx, that is looking good so far. In addition to using
lein run
or starting the binary as you did, you need to runnpm start
from the project root.
Thanks for your quick response. It works now (though I have yet to read meins doc to understand how to use it). If I understand it correctly, lein run
starts a server, and npm start
an electron based application, right? It would be good to have a brief introduction to the architecture in the README, as well as the two commands to start the application (Perhaps in install
section or a separate section? They are currently in Development
section, which I skipped because I was focusing on how to start the application first.)
The packaged version that you can create with
make release
would start the Java process in the background for you. That command would fail for you without myGH_TOKEN
in the environment, but it would still create the packaged version in./dist
. Please let me know if this helps.
I ran make install
. I didn't run make package
. Should I run it?
@rayx true, I need to spend some time on describing the architecture. Yes, there is a server process and the electron based frontend, and they talk to each other via a WebSockets connection. I had put the commands in the development section as you typically only need them during development, whereas in normal day-to-day usage, you can either package yourself with make package
, or simply download a packaged version from the release page.
@matthiasn I'm new to node.js, electron, and clojure. If I understand it correctly, the package in make package
is a electron package, right? So I ran make package
and the command completed successfully. Then I ran npm start meins
and the GUI showed up. Is this the recommended way to run the application?
Just curious, do I understand it correctly that, conceptually, npm start meins
effectively runs a script that does the following:
lein run &
npm start meins
BTW, I checked out the release page you provided, but it didn't have deb package, that's the reason why I ran make package
myself. That said, the command didn't generate any deb package in meins source code directory after it finished. Am I missing something?
Now that I'm able to start the GUI main window, I run into two more issues.
The main window shows up with nothing in it. Is this as expected? What's more, clicking menu items (I tried Application->Preferences
and File->New Entry
) has no effect. No new window shows up and no log messages in console.
If I press Ctl-C
to exit the application, there are always java processes uncleaned up. See below:
`-java,31404 -Dapple.awt.UIElement=true -Xmx2g -jar /localdata/github/meins/bin/jlink/meins.jar |-{java},31405 |-{java},31406 |-{java},31407 |-{java},31408 |- ... `-{java},31469
Any suggestions? Thanks.
(Let me know if you'd like me to move the discussion in a new thread because they are different issues).
When running make package
the electron packager outputs two formats, AppImage and Snap. These can be found in ./dist
. You can also download either and see if they are supported by your Linux distribution from releases. On Ubuntu, I am running the AppImage binary. You might have to run chmod +x
on them. The background process stays running indeed for faster startup, that's expected. If you want to close everything, there's a menu item Quit Background Services.
An empty window is definitely not expected after running lein run
and npm start
. Are you running shadow-cljs watch renderer
which compiles the JavaScript for development purposes, including hot reload? It sounds like the JS is missing. make package
only compiles the release version, so that won't help when starting with npm start
.
I'm not sure where the npm start meins
comes from, the lein run
and npm start
have to be started separately. Please let me know if this helps.
@matthiasn Thanks for your help. I'm able to get the AppImage binary and the development mode working, but snap package is still not working (I'll ignore it for now). More details below.
Note: the AppImage image and snap package I tried were built by me. I did downloaded AppImage from your release page, it worked too.
When running
make package
the electron packager outputs two formats, AppImage and Snap. These can be found in./dist
. You can also download either and see if they are supported by your Linux distribution from releases. On Ubuntu, I am running the AppImage binary. You might have to runchmod +x
on them.
Yes, the AppImage binary works.
The snap package doesn't work in my system. Below is its log:
$ meins
22:01:04:252 INFO [meins.electron.main.core:67] - Starting CORE: {:icon-path "/snap/meins/x1/resources/app/resources/icon.png",
:daily-logs-path
"/home/rayx/snap/meins/x1/.config/meins/data/daily-logs",
:capabilities nil,
:jar "/snap/meins/x1/resources/app/bin/jlink/meins.jar",
:blink "/snap/meins/x1/resources/app/bin/blink1-mac-cli",
:data-path "/home/rayx/snap/meins/x1/.config/meins/data",
:img-path "/home/rayx/snap/meins/x1/.config/meins/data/images",
:node-path "/usr/local/bin/node",
:logfile-electron "/tmp/meins-electron.log",
:download-path "/home/rayx/Downloads",
:cwd "/var/lib/snapd/void",
:index-page "resources/index.html",
:port 7788,
:electron-path "/snap/meins/x1/meins",
:resources-path "/snap/meins/x1/resources",
:repo-dir false,
:user-data "/home/rayx/snap/meins/x1/.config/meins",
:thumbs-path "/home/rayx/snap/meins/x1/.config/meins/data/thumbs",
:java "/snap/meins/x1/resources/app/bin/jlink/bin/java",
:cache "/home/rayx/snap/meins/x1/.config/meins/data/cache.dat",
:logdir "/tmp/",
:app-path "/snap/meins/x1/resources/app",
:help-page "http://localhost:7788/help/manual.html",
:pg-port 7787,
:gql-port 7789,
:pid-file "/home/rayx/snap/meins/x1/.config/meins/data/meins.pid",
:index-page-pg "resources/index-pg.html",
:logfile-jvm "/tmp/meins-jvm.log",
:manual-path "/snap/meins/x1/resources/app/doc",
:pg-pid-file
"/home/rayx/snap/meins/x1/.config/meins/playground-data/meins.pid",
:version "0.6.161",
:audio-path "/home/rayx/snap/meins/x1/.config/meins/data/audio",
:encrypted-path "/home/rayx/snap/meins/x1/.config/meins/encrypted",
:platform "linux",
:playground-path
"/home/rayx/snap/meins/x1/.config/meins/playground-data"}
22:01:04:278 INFO [meins.electron.main.update:41] - Starting UPDATE Component
22:01:04:288 INFO [meins.electron.main.menu:326] - Starting Menu Component
22:01:04:335 INFO [meins.electron.main.menu:315] - Starting Menu
22:01:04:443 INFO [meins.electron.main.startup:72] - JVM up? nil {:environment :live}
22:01:04:464 INFO [meins.electron.main.update:55] - UPDATE: check release versions
22:01:04:465 Checking for update
22:01:04:516 INFO [meins.electron.main.update:23] - Checking for update...
22:01:04:572 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:04:576 Error: Error: ENOENT: no such file or directory, open '/snap/meins/x1/resources/app-update.yml'
at c.d [as _captureStackTrace] (/snap/meins/x1/resources/app/prod/main-shadow/main.js:330:438)
at new f (/snap/meins/x1/resources/app/prod/main-shadow/main.js:388:280)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:394:349
at u.doCheckForUpdates (/snap/meins/x1/resources/app/prod/main-shadow/main.js:936:282)
at u.checkForUpdates (/snap/meins/x1/resources/app/prod/main-shadow/main.js:931:131)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9901:371
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9706:236
at Function.d [as cljs$core$IFn$_invoke$arity$1] (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9686:400)
at Object.cljs.core.async.impl.ioc_helpers.run_state_machine (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9377:161)
at Object.cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9378:116)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9379:239
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9326:119
at Immediate.cljs.core.async.impl.dispatch.process_messages (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9311:298)
at runCallback (timers.js:696:18)
at tryOnImmediate (timers.js:667:5)
at processImmediate (timers.js:649:5)
22:01:04:578 ERROR [meins.electron.main.update:39] - in auto-updater Error: ENOENT: no such file or directory, open '/snap/meins/x1/resources/app-update.yml'
22:01:04:611 INFO [matthiasn.systems-toolbox-electron.window-manager:25] - WM load-new file:///snap/meins/x1/resources/app/resources/loading.html {:width 400, :height 300, :show false, :webPreferences {:nodeIntegration true}, :icon nil}
Unhandled rejection Error: ENOENT: no such file or directory, open '/snap/meins/x1/resources/app-update.yml'
at c.d [as _captureStackTrace] (/snap/meins/x1/resources/app/prod/main-shadow/main.js:330:438)
at new f (/snap/meins/x1/resources/app/prod/main-shadow/main.js:388:280)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:394:349
at u.doCheckForUpdates (/snap/meins/x1/resources/app/prod/main-shadow/main.js:936:282)
at u.checkForUpdates (/snap/meins/x1/resources/app/prod/main-shadow/main.js:931:131)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9901:371
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9706:236
at Function.d [as cljs$core$IFn$_invoke$arity$1] (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9686:400)
at Object.cljs.core.async.impl.ioc_helpers.run_state_machine (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9377:161)
at Object.cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9378:116)
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9379:239
at /snap/meins/x1/resources/app/prod/main-shadow/main.js:9326:119
at Immediate.cljs.core.async.impl.dispatch.process_messages (/snap/meins/x1/resources/app/prod/main-shadow/main.js:9311:298)
at runCallback (timers.js:696:18)
at tryOnImmediate (timers.js:667:5)
at processImmediate (timers.js:649:5)
22:01:04:658 INFO [meins.electron.main.startup:24] - STARTUP: spawning /snap/meins/x1/resources/app/bin/jlink/bin/java ["-Dapple.awt.UIElement=true" "-Xmx2g" "-jar" "/snap/meins/x1/resources/app/bin/jlink/meins.jar"] {:detached true, :cwd "/home/rayx/snap/meins/x1/.config/meins", :env {:PORT 7788, :GQL_PORT 7789, :LOG_FILE "/tmp/meins-jvm.log", :LOG_DIR "/tmp/", :APP_PATH "/snap/meins/x1/resources/app", :DATA_PATH "/home/rayx/snap/meins/x1/.config/meins/data"}}
22:01:04:669 INFO [meins.electron.main.startup:148] - JVM: startup :live
22:01:05:627 INFO [meins.electron.main.startup:72] - JVM up? 1 {:environment :live}
22:01:05:786 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:05:792 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:06:799 INFO [meins.electron.main.startup:72] - JVM up? 2 {:environment :live}
22:01:07:785 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:07:790 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:08:797 INFO [meins.electron.main.startup:72] - JVM up? 3 {:environment :live}
22:01:09:786 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:09:794 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:10:801 INFO [meins.electron.main.startup:72] - JVM up? 4 {:environment :live}
22:01:11:785 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:11:792 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:12:810 INFO [meins.electron.main.startup:72] - JVM up? 5 {:environment :live}
22:01:13:786 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:13:791 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:14:799 INFO [meins.electron.main.startup:72] - JVM up? 6 {:environment :live}
22:01:19:590 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:19:606 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:20:618 INFO [meins.electron.main.startup:72] - JVM up? 7 {:environment :live}
22:01:28:049 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:28:053 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:29:063 INFO [meins.electron.main.startup:72] - JVM up? 8 {:environment :live}
22:01:29:624 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:29:633 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:30:641 INFO [meins.electron.main.startup:72] - JVM up? 9 {:environment :live}
22:01:37:642 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:01:37:654 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:01:38:662 INFO [meins.electron.main.startup:72] - JVM up? 10 {:environment :live}
22:02:04:257 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:02:04:261 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:02:05:269 INFO [meins.electron.main.startup:72] - JVM up? 11 {:environment :live}
22:03:04:307 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:03:04:311 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:03:05:322 INFO [meins.electron.main.startup:72] - JVM up? 12 {:environment :live}
22:03:14:503 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:03:14:522 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
22:03:15:531 INFO [meins.electron.main.startup:72] - JVM up? 13 {:environment :live}
22:03:19:272 INFO [meins.electron.main.startup:84] - - Nope, trying again
22:03:19:277 INFO [matthiasn.systems-toolbox-electron.window-manager:17] - WM: window id exists, not creating new one: resources/loading.html
The log showed two issues:
The ”no such file (/snap/meins/x1/resources/app-update.yml)“ issue. This seems not a critical one because I saw similar issue with development mode (it was dev-app-update.yml in that case). BTW, I didn't see this issue with AppImage binary. I checked the mounted direcory of AppImage binary and snap package, respectively, I couldn't find the yml file in mounte directory of snap pakcage indeed. So perhaps this is an issue with snap packaging (although it's not a critical one).
The ”WM: window id exists, not creating new one“ issue. This seemed to be a critical issue which prevented the application from starting up (there was a progress bar in the main window, with some text like "connecting meins backend" or something like that). I actually saw the same "WM: window id exists, not creating new one“ message when running AppImage binary, but in that case the message just appears 6 time or so and the backend service started up. In snap package case, however, the message repeated for ever, which seemed to indicate the backend service failed to start up for some reason. BTW, is there a way for me to check the backend service manually? I suppose the backend service is the web server started by "lein run" in developement mode? In development I can tell from console output that it listened at 8765 port, but when running the snap package or AppImage, I can't find the port in log and it wasn't 8765.
The background process stays running indeed for faster startup, that's expected. If you want to close everything, there's a menu item Quit Background Services.
Yes it works indeed! That said, I still think there is another issue with the current behavior when I click Quit
menu item. Since I start the AppImage binary in terminal, I notice that the command doesn't exit. If I kill the background process however, it exits immediately. Could it be that the electronic (the client side)'s connection with the background process somehow prevents the client process from exiting?
An empty window is definitely not expected after running
lein run
andnpm start
. Are you runningshadow-cljs watch renderer
which compiles the JavaScript for development purposes, including hot reload? It sounds like the JS is missing.make package
only compiles the release version, so that won't help when starting withnpm start
.
Thanks for pointing out this. I reread the Development
section of readme and got it working. BTW, I saw that shadow-cljs watch main
and npm start
processes output some error messages in console when I clicked menu items (though the application worked as expected). I'll ignore them for now.
I'm not sure where the
npm start meins
comes from, thelein run
andnpm start
have to be started separately. Please let me know if this helps.
My mistake. I'm not familiar with npm. I thought npm start meins
was same as npm start
. My original question was that, since in development mode we start the client process and server process separately, I suppose the same has to be done in some way when running the application in AppImage binary or snap package. But I didn't find the message about backend service's port and hence the question.
Hi @rayx, I'm now only building the AppImage
format and removed snap
. AppImage works for me, and it sounds like that's working for you as well. Closing this for now, if anyone needs the snap
format, please open a new ticket, and ideally help with making it work. Thanks!
No problem at all. I was trying the application mostly out of curiosity (I take text notes using emacs org-mode). I'm not familiar with the underlying stack of the application, but it seems interesting. Hopefully I'll take a closer look at it in future. Thanks.
Hi, I followed the procedure in README to build the code from source, everything seemed to work fine (there might be few warning messages but I didn't pay much attention to them). Then I started meins, it output the following message and stopped there, with no GUI interface showing up:
I'm not sure what exactly those "illegal reflective access" warning messages meant or if they mattered. Accessing the web server running at localhost:8765 returns only a simple "hello world..." text.
Below are the process tree:
Top or strace commands show that they are not doing anything interesting.
Any idea what went wrong? Thanks.