Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

UCP failed to install on first setup #37

Closed
si458 opened this issue Nov 14, 2018 · 15 comments
Closed

UCP failed to install on first setup #37

si458 opened this issue Nov 14, 2018 · 15 comments

Comments

@si458
Copy link
Contributor

si458 commented Nov 14, 2018

For some reason the UCP won't install on first setup?

but if you go into the GUI then install it manually from the Module Admin, it then installs without any issues?

Module pm2 successfully installed
Updating Hooks...Done
Resetting temporarily repository state
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
    0 [>---------------------------]
  100 [---------------->-----------]
2018-11-14T15:37:03.515584217Z 
Finished setting permissions
Reloading FreePBX
Successfully reloaded
Edge repository temporarily enabled
No repos specified, using: [standard] from last GUI settings
2018-11-14T15:37:20.291126404Z 
Downloading module 'ucp'
Processing ucp
Downloading...
  200 [---->-----------------------]       0/4260245 [>---------------------------]   0%
  426816/4260245 [==>-------------------------]  10%
  852264/4260245 [=====>----------------------]  20%
 1279080/4260245 [========>-------------------]  30%
 1707264/4260245 [===========>----------------]  40%
 2132712/4260245 [==============>-------------]  50%
 2556792/4260245 [================>-----------]  60%
 2984976/4260245 [===================>--------]  70%
 3410388/4260245 [======================>-----]  80%
 3838608/4260245 [=========================>--]  90%
2018-11-14T15:37:30.282660460Z 
Finished downloading
Extracting...Done
Download completed in 40 seconds
Updating tables ucp_sessions...Done
Home directory [/home/asterisk/.npm] is not writable
Unable to install module ucp:
 - Failed to run installation scripts
Updating Hooks...Done
Resetting temporarily repository state
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
 4260245/4260245 [============================] 100%    0 [>---------------------------]
  100 [---------------->-----------]
2018-11-14T15:41:14.399881306Z 
Finished setting permissions
@tiredofit
Copy link
Owner

Thanks for your contributions earlier today.
Home directory [/home/asterisk/.npm] is not writable stands out to me as interesting. Are you running this via docker-compose? I just tried a test install on my end and didn't exhibit that problem.

@si458
Copy link
Contributor Author

si458 commented Nov 14, 2018

your welcome, and more contribs to come :)

and that's what confused me because yes I am and after a google people say do the 'chown' before you install it, but the init file shows that it does just that, so I'm confused too?

OSX 10.14.1
Docker 18.06.1-ce-mac73

only thing I did differently was I created the yml file manually in visual studio code and run the 'docker compose up' function?

@tiredofit
Copy link
Owner

Wondering if there is something up when creating the exposed folders (./data) and permissions that is acting a strange on Mac. I can boot into a Mac installation a bit later today and see if I experience the same issue.

@si458
Copy link
Contributor Author

si458 commented Nov 14, 2018

this is my docker-compose.yml (in case I've done something wrong but its very basic)

version: '2'

services:
  freepbx-app:
    container_name: freepbx-app
    image: tiredofit/freepbx
    ports:
      - 80:80
      - 443:443
      - 5060:5060
      - 5160:5160
      - 18000-18100:18000-18100/udp
    volumes:
      - ./certs:/certs
      - ./data:/data
      - ./logs:/var/log
      - ./data/www:/var/www/html
      - ./db:/var/lib/mysql

    environment: 
      - ENABLE_FAIL2BAN=FALSE
      - ENABLE_FOP=FALSE
      - RTP_START=18000
      - RTP_FINISH=18100
      - DB_EMBEDDED=TRUE
      - UCP_FIRST=FALSE
      - TIMEZONE=Europe/London
      - ENABLE_ZABBIX=FALSE

    restart: always

    privileged: true

@tiredofit
Copy link
Owner

That's as basic as it gets - the volumes section looks great. I do some pretty weird shenanigans with the image build and then upon first boot of container to create a sort of persistence for some of the directories.
On first boot right before anything really gets started are you able to capture the ownership of /home/asterisk? Easiest way in my mind would be to not bring up the database server to let it get stuck on the initial sanity test.

@plemelin
Copy link

plemelin commented Nov 15, 2018

I had some issues this morning, but not only with UCP. After the first installation, I managed to create the admin user and from there, the FreePBX webpage mentioned that the dashboard modules was missing. I tried to install it and it would fail. I started looking in the logs and realized all modules failed the same way aborting (GPG Verify File check failed):

freepbx-app_1_84220dd26216 | Downloading module 'framework'
freepbx-app_1_84220dd26216 | Processing framework
freepbx-app_1_84220dd26216 | Downloading...
freepbx-app_1_84220dd26216 |         0/12842744 [>---------------------------]   0%
freepbx-app_1_84220dd26216 |   1287288/12842744 [==>-------------------------]  10%
freepbx-app_1_84220dd26216 |   2569104/12842744 [=====>----------------------]  20%
freepbx-app_1_84220dd26216 |   3855024/12842744 [========>-------------------]  30%
freepbx-app_1_84220dd26216 |   5138208/12842744 [===========>----------------]  40%
freepbx-app_1_84220dd26216 |   6422760/12842744 [==============>-------------]  50%
freepbx-app_1_84220dd26216 |   7707248/12842744 [================>-----------]  60%
freepbx-app_1_84220dd26216 |   8990496/12842744 [===================>--------]  70%
freepbx-app_1_84220dd26216 |  10275048/12842744 [======================>-----]  80%
freepbx-app_1_84220dd26216 | 
freepbx-app_1_84220dd26216 | Finished downloading
freepbx-app_1_84220dd26216 |  11560968/12842744 [=========================>--]  90%
freepbx-app_1_84220dd26216 | The following error(s) occured:
freepbx-app_1_84220dd26216 |  - File Integrity failed for /var/www/html/admin/modules/_cache/framework-14.0.5.1.tgz.gpg - aborting (GPG Verify File check failed)

This situation repeated itself as I was debugging (removing all volumes, restarting, etc). I tried a few debugging steps from the Freepbx forums to try to refresh the GPG keys without success.

I just erased everything again and launched my containers (I use a very similar docker-compose.yml file to the one in the example folder) and it just works now.

Is it possible something upstream is causing the issues we are seeing?

Here is my docker-compose file:

version: '3'

services:
  freepbx-app:
    image: tiredofit/freepbx
    ports:
      - 80:80
      - 5060:5060
      - 5160:5160
      - 18000-18100:18000-18100/udp
      - 4445:4445
    volumes:
      - ./data:/data
      - ./logs:/var/log
      - ./data/www:/var/www/html
    environment: 
      - VIRTUAL_HOST=10.0.13.200
      - VIRTUAL_PORT=80
      
      - ZABBIX_HOSTNAME=freepbx-app

      - RTP_START=18000
      - RTP_FINISH=18100

      - DB_EMBEDDED=FALSE

      - DB_HOST=freepbx-db
      - DB_PORT=3306
      - DB_NAME=asterisk
      - DB_USER=asterisk
      - DB_PASS=asteriskpass
    restart: always

  freepbx-db:
    image: tiredofit/mariadb
    restart: always
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=asterisk
      - MYSQL_USER=asterisk
      - MYSQL_PASSWORD=asteriskpass

@si458
Copy link
Contributor Author

si458 commented Nov 15, 2018

this is it RIGHT after it fails if this help

# ls -la /home/asterisk/
total 16
drwxr-xr-x 12 asterisk asterisk  384 Nov 14 09:25 .
drwxr-xr-x  3 asterisk asterisk   96 Nov 14 09:10 ..
-rw-r--r--  1 asterisk asterisk  220 Nov 14 09:10 .bash_logout
-rw-r--r--  1 asterisk asterisk 3526 Nov 14 09:10 .bashrc
drwx------  3 root     root       96 Nov 14 09:25 .config
drwxrwxr-x 13 asterisk asterisk  416 Nov 14 09:15 .gnupg
drwxr-xr-x  4 root     root      128 Nov 14 09:25 .node
drwxr-xr-x  6 root     root      192 Nov 14 09:26 .npm
-rw-r--r--  1 asterisk root       18 Nov 14 09:27 .npmrc
drwxr-xr-x  3 root     root       96 Nov 14 09:26 .package_cache
drwxrwxr-x 12 asterisk asterisk  384 Nov 14 09:27 .pm2
-rw-r--r--  1 asterisk asterisk  675 Nov 14 09:10 .profile

@plemelin
Copy link

@si458 Is it still failing if you start from scratch now?

@si458
Copy link
Contributor Author

si458 commented Nov 15, 2018

@plemelin I will do a full try from scratch abit later,
sadly my laptop isn't the quickest and it literally likes about 45mins to do a FULL setup

@tiredofit
Copy link
Owner

It very well could be an upstream issue - I know they are getting ready to release version 15 and there could be something going on here that we're not privvy too. Approximately a year ago we had some similar issues with GPG keys as well.In short term I'm thikning I might build in another environment variable that just installs the core framework without any additions so that users can get an install completed then perform rest of modules via the GUI.

@si458
Copy link
Contributor Author

si458 commented Nov 19, 2018

sorry for delay, been ill,
so after looking, still the same issue with NOT installing UCP?
I'm just wondering if we need to chown asterisk:asterisk the .npm folder MANUALLY BEFORE doing the UCP install?
(even tho the amportal chown SHOULD do that for us)

# ls -la /home/asterisk/
total 16
drwxr-xr-x 13 asterisk asterisk  416 Nov 19 00:40 .
drwxr-xr-x  3 asterisk asterisk   96 Nov 19 00:16 ..
-rw-r--r--  1 asterisk asterisk  220 Nov 19 00:16 .bash_logout
-rw-r--r--  1 asterisk asterisk 3526 Nov 19 00:16 .bashrc
drwx------  3 root     root       96 Nov 19 00:31 .config
drwxrwxr-x 14 asterisk asterisk  448 Nov 19 00:21 .gnupg
drwxr-xr-x  4 root     root      128 Nov 19 00:31 .node
drwxr-xr-x  6 root     root      192 Nov 19 00:31 .npm
-rw-r--r--  1 asterisk root       18 Nov 19 00:32 .npmrc
-rw-r--r--  1 root     root        0 Nov 19 00:40 .odbc.ini
drwxr-xr-x  3 root     root       96 Nov 19 00:32 .package_cache
drwxrwxr-x 12 asterisk asterisk  384 Nov 19 00:32 .pm2
-rw-r--r--  1 asterisk asterisk  675 Nov 19 00:16 .profile
#17 

@si458
Copy link
Contributor Author

si458 commented Nov 19, 2018

ok so managed to get UCP installed during the first setup

I had to put
chown -R asterisk. /home/asterisk/.npm
BEFORE
fwconsole ma downloadinstall ucp --edge

in the cont-init.d/10-freepbx file

not sure why the fwconsole is running as root instead of the asterisk user?

@plemelin
Copy link

@si458

I just tried with your exact docker-compose file and it installed UCP without any modifications to the containers. Did you try to do a clean install?

freepbx-app    | Downloading module 'ucp'
freepbx-app    | Processing ucp
freepbx-app    | Downloading...
freepbx-app    |        0/4260245 [>---------------------------]   0%
freepbx-app    |   429472/4260245 [==>-------------------------]  10%
freepbx-app    |   852264/4260245 [=====>----------------------]  20%
freepbx-app    |  1279064/4260245 [========>-------------------]  30%
freepbx-app    |  1711320/4260245 [===========>----------------]  40%
freepbx-app    |  2136784/4260245 [==============>-------------]  50%
freepbx-app    |  2559512/4260245 [================>-----------]  60%
freepbx-app    |  2986328/4260245 [===================>--------]  70%
freepbx-app    |  3411760/4260245 [======================>-----]  80%
freepbx-app    |  3834472/4260245 [=========================>--]  90%
freepbx-app    |  4260245/4260245 [============================] 100%
freepbx-app    | Finished downloading
freepbx-app    | Extracting...Done
freepbx-app    | Download completed in 1 seconds
freepbx-app    | Updating tables ucp_sessions...Done
freepbx-app    | Installing/Updating Required Libraries. This may take a while...The following messages are ONLY FOR DEBUGGING. Ignore anything that says 'WARN' or is just a warning
freepbx-app    | Found npm-cache v0.7.0
freepbx-app    | Running installation..
freepbx-app    | [npm-cache] [INFO] using /home/asterisk/.package_cache as cache directory
freepbx-app    | [npm-cache] [INFO] [composer] Dependency config file /var/www/html/admin/modules/ucp/node/composer.json does not exist. Skipping install
freepbx-app    | [npm-cache] [INFO] [npm] config file exists
freepbx-app    | [npm-cache] [INFO] [npm] cli exists
freepbx-app    | [npm-cache] [INFO] [npm] hash of /var/www/html/admin/modules/ucp/node/package.json: 76ab6df0c1940daaf47b99501250de86
freepbx-app    | [npm-cache] [INFO] [npm] running [npm install]...
freepbx-app    | npm WARN deprecated node-uuid@1.4.7: Use uuid module instead

@si458
Copy link
Contributor Author

si458 commented Nov 19, 2018

yes I did this morning just before I posted and it still failed
but I deleted all images, copied the git then changed the init file and run docker build to make my own image, then tried and it worked with the chown in place

I'm wondering if its maybe a OSX docker issue?

@si458
Copy link
Contributor Author

si458 commented Nov 21, 2018

ok wonderful, thank you!
all the pull requests merged and working successfully!
both in latest and 2.11!

@si458 si458 closed this as completed Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants