Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved dolibarr - ERP & CRM for Business

    App Wishlist
    10
    44
    1117
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nebulon
      nebulon Staff last edited by

      There is no env var injected in such cases. You would have to somehow figure out if the db setup was already done or not. Often this is done via a state file like https://git.cloudron.io/cloudron/wordpress-app/-/blob/master/start.sh#L39

      E 1 Reply Last reply Reply Quote 0
      • E
        erics App Dev @nebulon last edited by

        @nebulon thanks, i will do a test with that (but i already have a file-flag), ... is data backup restored "before" start.sh is launched ?

        i will make a test πŸ™‚

        i have an other question, how could a do a loop in tests.js like that pseudo code:

        Note: i have a message on index.php "database install in progress please come back later"

        so here is what i try to do in test.js

        while(web index contains "database setup in progress")
        sleep(300)
        loop

        girish 2 Replies Last reply Reply Quote 0
        • girish
          girish Staff @erics last edited by

          @erics said in dolibarr - ERP & CRM for Business:

          @nebulon thanks, i will do a test with that (but i already have a file-flag), ... is data backup restored "before" start.sh is launched ?

          Yes. When a restore is done, start.sh is called after the database is restore and all the files in /app/data are already in place. This is why you don't really need to know if it's upgrade/install/backup. In the case of your code, that install.lock at https://git.cloudron.io/cloudron/dolibarr-app/-/blob/master/start.sh#L14 will already be present. And thus, the whole install block will get skipped when an app is restored.

          1 Reply Last reply Reply Quote 0
          • girish
            girish Staff @erics last edited by girish

            @erics said in dolibarr - ERP & CRM for Business:

            Note: i have a message on index.php "database install in progress please come back later"
            so here is what i try to do in test.js
            while(web index contains "database setup in progress")
            sleep(300)
            loop

            I think for the tests at least, it's fine to just sleep(20-30 seconds or whatever is for sure to work). Just do something like:

            function install(done) {
                execSync('cloudron install ...');
                console.log('waiting for 30 seconds for database setup to complete');
                setTimeout(done, 30 * 1000);
            }
            

            Regardless of the tests, if you have a "healthCheckPath" which is more reliable i.e it returns 2xx or 3xx http status only after db setup is complete and app is ready to use then you can put that in https://git.cloudron.io/cloudron/dolibarr-app/-/blob/master/CloudronManifest.json#L8 . If you have such a route in the app, then you don't need the sleep above. This also has the advantage that the user will see 'Running' in cloudron dashboard only when it's ready to use (otherwise, right now, he will see db is getting setup message).

            E 2 Replies Last reply Reply Quote 0
            • E
              erics App Dev @girish last edited by

              @girish so nice πŸ™‚

              for the moment i have an other problem with "App restore error: Installation failed: Cannot download from noop backend"

              Oct 07 23:39:56 box:shell clearVolume spawn: /usr/bin/sudo -S /home/yellowtent/box/src/scripts/clearvolume.sh clear /home/yellowtent/appsdata/773326e5-e8f3-490c-8147-76c35839873f/data
              Oct 07 23:39:56 box:backups download: Downloading 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3 of format tgz to {"localRoot":"/home/yellowtent/appsdata/773326e5-e8f3-490c-8147-76c35839873f","layout":[]}
              Oct 07 23:39:56 box:storage/noop download: 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3.tar.gz
              Oct 07 23:39:23 Fresh installation, performing Dolibarr first time setup
              Oct 07 23:39:23 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.8. Set the 'ServerName' directive globally to suppress this message
              Oct 07 23:39:23 - STEP NΒ°1 ...
              Oct 07 23:39:24 [done]
              Oct 07 23:39:24 - STEP NΒ°2 ...
              Oct 07 23:39:24 [done]
              Oct 07 23:39:24 - STEP NΒ°3 ...
              Oct 07 23:40:16 box:storage/noop download: 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3.tar.gz
              Oct 07 23:40:36 box:storage/noop download: 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3.tar.gz
              Oct 07 23:40:56 box:storage/noop download: 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3.tar.gz
              Oct 07 23:41:16 box:storage/noop download: 2020-10-07-213836-698/app_92291923-34a2-4ca0-9637-430e75e3f679_2020-10-07-213838-779_v0.1.3.tar.gz
              Oct 07 23:41:16 box:backups downloadApp: time: 80.01
              Oct 07 23:41:16 box:apptask test.xxxxxxxxxxx.fr error installing app: BoxError: Cannot download from noop backend
              Oct 07 23:41:16 box:apptask test.xxxxxxxxxxx.fr updating app with values: {"installationState":"error","error":{"message":"Cannot download from noop backend","reason":"Not implemented","taskId":"93","installationState":"pending_restore"}}
              Oct 07 23:41:16 box:taskworker Task took 103.994 seconds
              Oct 07 23:41:16 box:tasks setCompleted - 93: {"result":null,"error":{"stack":"BoxError: Cannot download from noop backend\n at Object.download (/home/yellowtent/box/src/storage/noop.js:59:14)\n at /home/yellowtent/box/src/backups.js:774:40\n at Timeout.retryAttempt [as _onTimeout] (/home/yellowtent/box/node_modules/async/dist/async.js:4611:9)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)","name":"BoxError","reason":"Not implemented","details":{},"message":"Cannot download from noop backend"}}
              Oct 07 23:41:16 box:tasks 93: {"percent":100,"result":null,"error":{"stack":"BoxError: Cannot download from noop backend\n at Object.download (/home/yellowtent/box/src/storage/noop.js:59:14)\n at /home/yellowtent/box/src/backups.js:774:40\n at Timeout.retryAttempt [as _onTimeout] (/home/yellowtent/box/node_modules/async/dist/async.js:4611:9)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)","name":"BoxError","reason":"Not implemented","details":{},"message":"Cannot download from noop backend"}}
              
              girish 1 Reply Last reply Reply Quote 0
              • E
                erics App Dev @girish last edited by

                @girish healthCheckPath is PERFECT !

                1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @erics last edited by

                  @erics said in dolibarr - ERP & CRM for Business:

                  for the moment i have an other problem with "App restore error: Installation failed: Cannot download from noop backend"

                  Looks like the Cloudron server which you are installing/testing this on has backups disabled! Go to Backups -> change to file system or something. Without backups, one cannot restore.

                  E 1 Reply Last reply Reply Quote 0
                  • E
                    erics App Dev @girish last edited by erics

                    @girish yes (i'm) so stupid i just found it now πŸ™‚

                    1 Reply Last reply Reply Quote 0
                    • E
                      erics App Dev last edited by

                      New question : does ".lock" files could be excluded from backups ?

                      when dolibarr install is complete a install.lock file is created, but when cloudron backup is restaured this file is missing ...

                      E 1 Reply Last reply Reply Quote 0
                      • E
                        erics App Dev @erics last edited by

                        ok, i switched from install.lock to .dbsetup file like wordpress and hoooraaa it works πŸ™‚

                        new problem during autotest: database error on test2 + restoring data ... next step tomorrow !

                        E 1 Reply Last reply Reply Quote 0
                        • E
                          erics App Dev @erics last edited by

                          00:41 $ USERNAME=cloudronusername PASSWORD=cloudronpassword node_modules/.bin/mocha --bail test.js
                          
                            Application life cycle test
                              - build app
                              installation and configuration
                          App is being installed.
                          
                           => Queued 
                           => Cleaning up old install 
                           => Downloading image ..........
                           => Creating container .
                           => Wait for health check .........................................
                          
                          App is installed.
                                βœ“ install app (61950ms)
                                βœ“ can get app information (475ms)
                                βœ“ can view welcome page (812ms)
                                βœ“ can login (2045ms)
                          
                           => Queued 
                           => Snapshotting app test.example.com 
                           => Uploading app snapshot test.example.com 
                           => Uploading backup 1M@1MBps (test.example.com) 
                          
                          App is backed up
                                βœ“ backup app (5252ms)
                          
                           => Waiting for app to be uninstalled 
                           => Queued 
                           => Deleting container 
                           => Teardown addons ...
                           => Unregistering domains 
                          
                          App test.example.com successfully uninstalled.
                          App is being installed.
                          
                           => Queued 
                           => Cleaning up old install 
                           => Downloading image .........
                           => Creating container ..
                           => Wait for health check ............................................................
                          
                          App is installed.
                          
                           => Queued 
                           => Cleaning up old install 
                           => Registering subdomains 
                           => Downloading image 
                           => Download backup and restoring addons ........
                           => Downloading 1M@1MBps ...................
                           => Creating container 
                           => Waiting for DNS propagation 
                           => Wait for health check 
                          
                          App is restored
                                βœ“ restore app (131164ms)
                          
                           => Queued 
                           => Cleaning up old install .
                           => Registering subdomains .
                           => Creating container 
                           => Wait for health check ..
                          
                          App configured
                                βœ“ move to different location (10705ms)
                                βœ“ can access dashboard (508ms)
                          
                           => Waiting for app to be uninstalled 
                           => Queued 
                           => Deleting container 
                           => Teardown addons ........
                           => Deleting image 
                           => Unregistering domains 
                          
                          App test2.example.com successfully uninstalled.
                                βœ“ uninstall app (15220ms)
                              update
                          Failed to get app info from store: 404 message: No such app
                                1) can install app
                          
                          
                            9 passing (4m)
                            1 pending
                            1 failing
                          
                            1) Application life cycle test
                                 update
                                   can install app:
                               Error: Command failed: cloudron install --appstore-id org.dolibarr.cloudronapp --location test
                                at checkExecSyncError (child_process.js:630:11)
                                at execSync (child_process.js:666:15)
                                at Context.<anonymous> (test.js:195:13)
                                at processImmediate (internal/timers.js:456:21)
                          
                          
                          1 Reply Last reply Reply Quote 1
                          • girish
                            girish Staff last edited by girish

                            @erics Great progress so far! I guess we need to publish the app to the appstore for the update test to work. Let me do that right now.

                            BTW, just a quick note: If there is some upgrade script that needs to be run, we have to do it in the else clause of https://git.cloudron.io/cloudron/dolibarr-app/-/blob/master/start.sh#L14 . Or does dolibarr automatically update/run new db migrations on first run of new version?

                            1 Reply Last reply Reply Quote 1
                            • girish
                              girish Staff last edited by

                              @erics It's published as unstable now. You can try the update test now.

                              E 2 Replies Last reply Reply Quote 2
                              • E
                                erics App Dev @girish last edited by erics

                                @girish excellent, i will continue a bit later.

                                just a note about git (https://git.cloudron.io/cloudron/dolibarr-app) : i don't have write access so i made a merge request wich is "Ready to be merged automatically. Ask someone with write access to this repository to merge this request "

                                girish 1 Reply Last reply Reply Quote 0
                                • E
                                  erics App Dev @girish last edited by

                                  @girish that's pleasant :

                                  00:45 $ USERNAME=cloudronusername PASSWORD=cloudronpassword node_modules/.bin/mocha --bail test.js
                                  Application life cycle test
                                  - build app
                                  installation and configuration
                                  App is being installed.

                                  => Queued
                                  => Cleaning up old install
                                  => Downloading image ........................
                                  => Creating container .
                                  => Wait for health check ......................................

                                  App is installed.
                                  βœ“ install app (74925ms)
                                  βœ“ can get app information (566ms)
                                  βœ“ can view welcome page (860ms)
                                  βœ“ can login (2159ms)

                                  => Queued
                                  => Snapshotting app test.example.com
                                  => Uploading app snapshot test.example.com

                                  App is backed up
                                  βœ“ backup app (4109ms)

                                  => Waiting for app to be uninstalled
                                  => Queued
                                  => Deleting container
                                  => Teardown addons ...
                                  => Deleting image

                                  App test.example.com successfully uninstalled.
                                  App is being installed.

                                  => Queued
                                  => Cleaning up old install
                                  => Downloading image .........
                                  => Creating container .
                                  => Configuring reverse proxy
                                  => Wait for health check ................................

                                  App is installed.

                                  => Queued
                                  => Cleaning up old install
                                  => Registering subdomains
                                  => Downloading image
                                  => Download backup and restoring addons ..
                                  => Downloading 1M@1MBps .........
                                  => Creating container .
                                  => Wait for health check ........

                                  App is restored
                                  βœ“ restore app (92784ms)

                                  => Queued
                                  => Cleaning up old install .
                                  => Creating container
                                  => Waiting for DNS propagation
                                  => Wait for health check ..

                                  App configured
                                  βœ“ move to different location (9759ms)
                                  βœ“ can access dashboard (477ms)

                                  => Waiting for app to be uninstalled
                                  => Queued
                                  => Deleting container
                                  => Teardown addons ...
                                  => Unregistering domains

                                  App test2.example.com successfully uninstalled.
                                  βœ“ uninstall app (8769ms)
                                  update
                                  App is being installed.

                                  => Queued
                                  => Downloading icon
                                  => Registering subdomains
                                  => Downloading image
                                  => Creating container
                                  => Wait for health check ..

                                  App is installed.
                                  βœ“ can install app (11025ms)
                                  βœ“ can get app information (564ms)
                                  βœ“ can view welcome page (308ms)

                                  => Waiting for app to be uninstalled
                                  => Queued
                                  => Deleting container ..........
                                  => Teardown addons ......
                                  => Unregistering domains

                                  App test.example.com successfully uninstalled.
                                  βœ“ uninstall app (22671ms)

                                  13 passing (4m)
                                  1 pending

                                  1 Reply Last reply Reply Quote 1
                                  • luckow
                                    luckow translator last edited by

                                    Thank you for the packaging of dolibarr.
                                    My first 2 cents: let us define, that first language has to be english. It took me around 5 minutes to find out where I can switch from french to english πŸ™‚

                                    Pronouns: he/him | Primary language: German

                                    girish 1 Reply Last reply Reply Quote 4
                                    • girish
                                      girish Staff @erics last edited by

                                      @erics said in dolibarr - ERP & CRM for Business:

                                      just a note about git (https://git.cloudron.io/cloudron/dolibarr-app) : i don't have write access so i made a merge request wich is "Ready to be merged automatically. Ask someone with write access to this repository to merge this request "

                                      Can you please check now? I made you a maintainer of the project.

                                      1 Reply Last reply Reply Quote 0
                                      • girish
                                        girish Staff @luckow last edited by

                                        @luckow said in dolibarr - ERP & CRM for Business:

                                        My first 2 cents: let us define, that first language has to be english. It took me around 5 minutes to find out where I can switch from french to english

                                        Ha ha, yes, please πŸ™‚ Would be great if the tests also look for english strings so @nebulon and I can easily continue to maintain it.

                                        I did give dolibarr a quick run yesterday, I am looking forward to using it for Cloudron the company as well.

                                        E 2 Replies Last reply Reply Quote 1
                                        • E
                                          erics App Dev @girish last edited by

                                          Ok i will have a look for language.

                                          i was imagine by default that it was auto detect from browser locale ...

                                          Thanks for this first "bug report" i mean πŸ™‚

                                          1 Reply Last reply Reply Quote 2
                                          • E
                                            erics App Dev @girish last edited by erics

                                            @girish @luckow done πŸ™‚ install is now multilang and based on browser-locale ! please wait for one or two min i will push that code on git ! (thanks @girish now i can write on main git repo).

                                            1 Reply Last reply Reply Quote 4
                                            • scooke
                                              scooke last edited by

                                              Amazing! You are all simply amazing!

                                              A life lived in fear is a life half-lived

                                              1 Reply Last reply Reply Quote 3
                                              • girish
                                                girish Staff last edited by girish

                                                @erics I made a new build and published a new version. BTW, if dolibarr sends emails, we need to configure email somewhere using the CLOUDRON_MAIL_* env vars

                                                E 2 Replies Last reply Reply Quote 0
                                                • E
                                                  erics App Dev @girish last edited by

                                                  @girish yes that's my next step πŸ™‚

                                                  E 1 Reply Last reply Reply Quote 0
                                                  • E
                                                    erics App Dev @girish last edited by

                                                    This post is deleted!
                                                    1 Reply Last reply Reply Quote 0
                                                    • E
                                                      erics App Dev @erics last edited by

                                                      Ok, a new checkbox is checked πŸ™‚

                                                      mail configuration

                                                      marcusquinn 1 Reply Last reply Reply Quote 3
                                                      • marcusquinn
                                                        marcusquinn @erics last edited by

                                                        @erics Hey - nice work on this! I've just been exploring and it's come on a long way since the last time I look - congratulations on a solid app that I think will be an asset to Cloudron users as a mature ERP option. ⭐

                                                        We're not here for a long time - but we are here for a good time :)
                                                        Jersey/UK
                                                        Work & Ecommerce Advice: https://brandlight.org
                                                        Personal & Software Tips: https://marcusquinn.com

                                                        1 Reply Last reply Reply Quote 2
                                                        • girish
                                                          girish Staff last edited by

                                                          @erics Is the app ready as such or do you have any pending tasks? We can take it from here, if that's the case.

                                                          1 Reply Last reply Reply Quote 2
                                                          • robi
                                                            robi last edited by robi

                                                            Is LDAP supposed to be working?
                                                            I can't log in via Cloudron user credentials w/o creating a separate account in Dolibarr.

                                                            Life of Gratitude.
                                                            Life of Advanced Technology

                                                            BrutalBirdie 1 Reply Last reply Reply Quote 0
                                                            • BrutalBirdie
                                                              BrutalBirdie Staff @robi last edited by

                                                              @robi => @luckow wrote

                                                              What is the reason to login as an admin, select ldap users from a dropdown and add them to the userbase in dolibarr? Without that workflow it isn't possible to login as an allowed user (from the cloudron app/dashboard perspective).

                                                              Tested with a fresh installation.

                                                              https://forum.cloudron.io/topic/3474/unusual-ldap-user-workflow?_=1604397103462

                                                              Like my work? Consider donating a beer 🍻 Cheers!

                                                              BrutalBirdie 1 Reply Last reply Reply Quote 2
                                                              • BrutalBirdie
                                                                BrutalBirdie Staff @BrutalBirdie last edited by

                                                                Since @robi and @luckow has fallen for this trap, I will assume other users will fall for it as well.

                                                                Maybe mention this behavior in the initial setup notification?

                                                                Like my work? Consider donating a beer 🍻 Cheers!

                                                                1 Reply Last reply Reply Quote 1
                                                                • robi
                                                                  robi last edited by

                                                                  I think this is a bug where the LDAP -> Dolibarr part of the LDAP plugin isn't populating users.

                                                                  Hope @erics or @staff can take a look.

                                                                  Life of Gratitude.
                                                                  Life of Advanced Technology

                                                                  1 Reply Last reply Reply Quote 0
                                                                  • jdaviescoates
                                                                    jdaviescoates last edited by

                                                                    @staff this is now in the app store and marked as stable so I guess this should be marked as solved πŸ™‚

                                                                    I use Cloudron with Gandi & Hetzner

                                                                    1 Reply Last reply Reply Quote 0
                                                                    • nebulon
                                                                      nebulon Staff last edited by

                                                                      Thanks for the reminder. The forum section for Dolibarr is at https://forum.cloudron.io/category/107/dolibarr

                                                                      I will mark this then as solved and lock the thread.

                                                                      1 Reply Last reply Reply Quote 1
                                                                      • First post
                                                                        Last post
                                                                      Powered by NodeBB