YunoHost-Apps / codimd_ynh

CodiMD package for YunoHost
https://hackmd.io/
GNU General Public License v3.0
11 stars 12 forks source link

Fix install + bump to version 1.6 #19

Closed Lab-8916100448256 closed 4 years ago

Lab-8916100448256 commented 4 years ago

This is to upgrade to CodiMD version 1.6, issue #18

Tested on a Debian 9 virtual machine with yunohost 3.6.5.3.

CodiMD version 1.6 is supposed to still be compatible with nodejs version 8 but there was an error of a dependency complaining about nodejs version being too old. So I had to bump node version

The first commits are reverted. they were attempts at pinning yarn version to an older release to work around the issue with yarn error no such option: --pure-lockfile. I failed at doing that in the script. I'm new to yunohost API Instead I did it with a file on the server, as described in https://github.com/YunoHost-Apps/codimd_ynh/issues/17#issuecomment-596600690

lapineige commented 4 years ago

It still fails for me :((

Warning: [DEBUG]: DEBUG - + ynh_script_progression '--message=Building application... (this may take some time and resources!)' Warning: [DEBUG]: DEBUG - + set +x Warning: [DEBUG]: DEBUG - + set +x Warning: [DEBUG]: DEBUG - + echo '! Helper used in legacy mode !' Warning: [DEBUG]: DEBUG - + set +x Warning: [DEBUG]: DEBUG - > Building application... (this may take some time and resources!)' Warning: [DEBUG]: DEBUG - + set -x Warning: [DEBUG]: DEBUG - + pushd /var/www/codimd Warning: [DEBUG]: DEBUG - /var/www/codimd /var/cache/yunohost/from_file/codimd_ynh-CodiMD-1.6/scripts Warning: [DEBUG]: DEBUG - + ./bin/setup Warning: [DEBUG]: DEBUG - copy config files Warning: [DEBUG]: DEBUG - install packages Warning: [DEBUG]: DEBUG - + ynh_exit_properly Warning: Info: The operation 'Install 'codimd' application' has failed! To get help, please share the full log of this operation using the command 'yunohost log display DateAndTime-app_install-codimd --share'

lapineige commented 4 years ago

Do you take into account this issue ? https://github.com/YunoHost-Apps/codimd_ynh/issues/20 I'm not sure to understand if it's the case or not.

Lab-8916100448256 commented 4 years ago

Do you take into account this issue ? #20 I'm not sure to understand if it's the case or not.

No, not in this PR. I worked around this issue locally on my server by blocking it from installing newer versions of yarn. as described in my comment here : https://github.com/YunoHost-Apps/codimd_ynh/issues/17#issuecomment-596600690

lapineige commented 4 years ago

Shouldn't we add that fix, if it's simply a matter of removing an argument ?

Lab-8916100448256 commented 4 years ago

I haven't found this argument in the yunohost app script. It is in CodyMD install script : https://github.com/codimd/server/blob/master/bin/setup

I'm no yunohost expert. Maybe there is a way to patch the setup script on the fly on yunohost side. But I think this should be patched upstream in CodyMD repository

alexAubin commented 4 years ago

Randomly passing by, tested on Yunohost unstable in a LXC and the install seem to work ... Would love to see this app flagged as working in the app catalog

alexAubin commented 4 years ago

Naively started a build on the dev CI, will see how it goes (after pixelfed finishes :sweat_smile: ) https://ci-apps-dev.yunohost.org/jenkins/view/aleks/job/codimd_ynh%20(aleks)/

lapineige commented 4 years ago

Would love to see this app flagged as working in the app catalog

Would love to get it working :sweat_smile:

lapineige commented 4 years ago

It failed :(

alexAubin commented 4 years ago

Sounds like a silly issue about manifest.json default value for is_public ... restarted a build after small fix (c.f. previous commit)

alexAubin commented 4 years ago

Alright, there was some stupid crazy bug in the add_extra_apt_repo ... The --pure-lockfile bug was in fact due to yarn not being installed at all (so it kept some old version like 0.2 which didnt had this option).

Last build is at least installable : https://ci-apps-dev.yunohost.org/jenkins/view/aleks/job/codimd_ynh%20(aleks)/7/console

There's a 502 error in some more advanced test, probably because this is a heavy app that may take some time to load. Should probably add some options to "systemd_action start" to wait until the service is ready as for other apps.

But at least the app should be installable... (well modulo the fact that it seems to take as much CPU as mining 10 bitcoins just to build web assets lulz...)

alexAubin commented 4 years ago

I'm taking the liberty to yolomerge this because the app is still flagged as "inprogress" for now on the applist anyway... Thanks @Lab-8916100448256 for the initial work on the PR

lapineige commented 4 years ago

And not working anyway, so it's a good thing your merged it.

After one or two thousand warnings (while building web assets), install succeed :) :tada: It seems to work like a charm.

Thanks a lot @alexAubin and @Lab-8916100448256 :slightly_smiling_face:

lapineige commented 4 years ago

Install fails with a raspberry pi (or any ARM architecture ?) Logs: https://vps.lapineige.fr/privatebin/?01f5b00ceed9b4f9#S+xOn2Zmm9FK3RETGX5tnzmsAsr01XWLhz8tMHvW0sQ=

Full log, with lots of warnings/error messages: https://vps.lapineige.fr/privatebin/?6d61a804ee927e9c#+b7zubYX+KX+Kp5nu4EcMonXJWqY8+bWvAfv/F1WH5M=

alexAubin commented 4 years ago

@lapineige Huuuu wokay, naively that looks like some temporary network issue ? x_X

lapineige commented 4 years ago

Same issue on second try :(

lapineige commented 4 years ago

More details with debug mode, third try: https://vps.lapineige.fr/privatebin/?9ee1ae1c80744b39#t/M31zHuhuF2NBJ1Mr4OxKeSqsArPPihLc/NZrYh7LM=

alexAubin commented 4 years ago

Alright, totally different error :

497568 WARNING Output:
497569 WARNING PhantomJS not found on PATH
497570 WARNING Unexpected platform or architecture: linux/arm
497572 WARNING It seems there is no binary available for your platform/architecture
497575 WARNING Try to install PhantomJS globally

It sounds like it needs something called PhantomJS and that let me think it not available for arm ... Maybe there's a slight chance we just need to install this manually somehow but I doubt

If that's confirmed that it's not available on arm, we should add a check for architecture at the beginning of the install script then..

lapineige commented 4 years ago

It seems not to be available officially as a prebuilt package. After a quick search, it seems that it's possible to compile it for ARM. Examples: https://github.com/fg2it/phantomjs-on-raspberry https://github.com/aeberhardo/phantomjs-linux-armv6l

I don't know if we should try to compile it on-the-fly (on ARM it might takes forever…), or use one of these repository (with what kind of security risk ?) and maybe mark the support as experimental, or just disable ARM support (which will especially exclude all Raspberry Pi and Internet Cube owners… a lot of Yunohost users).

nazmifr commented 4 years ago

I was faced with the fact that I can't install this app today, I dug a bit, especially on here:

https://github.com/Medium/phantomjs/issues/433#issuecomment-368492188

Turns out there is a package on the raspbian reps, it won't work on a headless server so I tried to define the variable in bash, it failed, so I tried to add it to /etc/environment which failed too, I get this error


04:56,014: WARNING - Considering PhantomJS found at /usr/bin/phantomjs
2020-09-06 23:04:56,015: DEBUG - + trap '' EXIT
2020-09-06 23:04:56,016: WARNING - Found PhantomJS at /usr/bin/phantomjs ...verifying
2020-09-06 23:04:56,016: DEBUG - + set +o errexit
2020-09-06 23:04:56,017: WARNING - Error verifying phantomjs, continuing Error: Command failed: /usr/bin/phantomjs --version
2020-09-06 23:04:56,017: DEBUG - + set +o nounset
2020-09-06 23:04:56,018: WARNING - qt.qpa.screen: QXcbConnection: Could not connect to display
2020-09-06 23:04:56,018: DEBUG - + sleep 0.5
2020-09-06 23:04:56,019: WARNING - Could not connect to any X display.
2020-09-06 23:04:56,019: WARNING - 
2020-09-06 23:04:56,020: WARNING -     at ChildProcess.exithandler (child_process.js:303:12)
2020-09-06 23:04:56,021: WARNING -     at ChildProcess.emit (events.js:315:20)
2020-09-06 23:04:56,021: WARNING -     at maybeClose (internal/child_process.js:1021:16)
2020-09-06 23:04:56,022: WARNING -     at Socket.<anonymous> (internal/child_process.js:443:11)
2020-09-06 23:04:56,023: WARNING -     at Socket.emit (events.js:315:20)
2020-09-06 23:04:56,024: WARNING -     at Pipe.<anonymous> (net.js:674:12) {
2020-09-06 23:04:56,024: WARNING -   killed: false,
2020-09-06 23:04:56,025: WARNING -   code: 1,
2020-09-06 23:04:56,026: WARNING -   signal: null,
2020-09-06 23:04:56,026: WARNING -   cmd: '/usr/bin/phantomjs --version'
2020-09-06 23:04:56,027: WARNING - }
2020-09-06 23:04:56,028: WARNING - Unexpected platform or architecture: linux/arm
2020-09-06 23:04:56,029: WARNING - It seems there is no binary available for your platform/architecture
2020-09-06 23:04:56,029: WARNING - Try to install PhantomJS globally

Is there any method to edit the script and add the variable for Qt before installing?