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

contacts not downloadable #44

Closed
eplusk opened this issue Oct 11, 2016 · 5 comments
Closed

contacts not downloadable #44

eplusk opened this issue Oct 11, 2016 · 5 comments

Comments

@eplusk
Copy link

eplusk commented Oct 11, 2016

Steps to reproduce

  1. started script nextcloud_install_production.sh
  2. new script with install contact only

install_contacts.sh.txt

Expected behaviour

first part of an new install should happen.

Actual behaviour

version 1.5.0.0 could not be downloaded

Server configuration

Server version: (see your admin page)
nextcloud 10.0.1
VM version
ubuntu server 16.4.1

fresh install:
only first Part until first reboot.

Logs

Web server error log

Insert your install contacts log here

kk@nctest3:~$ sudo bash install_contacts.sh 2>&1 | tee contacts.log
[sudo] Passwort für kk: 
+ WWW_ROOT=/var/www
+ NCPATH=/var/www/nextcloud
++ wget -q https://raw.githubusercontent.com/owncloud/contacts/master/appinfo/info.xml
++ grep -Po '(?<=<version>)[^<]*(?=</version>)' info.xml
++ rm info.xml
+ CONVER=1.5.0.0
+ echo 'ContactVersion = 1.5.0.0'
ContactVersion = 1.5.0.0
+ CONVER_FILE=contacts.tar.gz
+ CONVER_REPO=https://github.com/owncloud/contacts/releases/download
+ '[' -d /var/www/nextcloud/apps/contacts ']'
+ wget -q https://github.com/owncloud/contacts/releases/download/v1.5.0.0/contacts.tar.gz -P /var/www/nextcloud/apps
+ tar -zxf /var/www/nextcloud/apps/contacts.tar.gz -C /var/www/nextcloud/apps
tar (child): /var/www/nextcloud/apps/contacts.tar.gz: Funktion open fehlgeschlagen: Datei oder Verzeichnis nicht gefunden
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
+ cd /var/www/nextcloud/apps
+ rm contacts.tar.gz
rm: das Entfernen von 'contacts.tar.gz' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
+ '[' -d /var/www/nextcloud/apps/contacts ']'




@eplusk
Copy link
Author

eplusk commented Oct 12, 2016

I found some more errors in nextcloud-install-production.sh

  1. Home-dir from ncadmin

    root@nctest3:~# cd ../ncadmin
    root@nctest3:/home/ncadmin# ll
    insgesamt 20
    drwxr-xr-x 2 ncadmin ncadmin 4096 Okt 11 20:12 ./
    drwxr-xr-x 4 root root 4096 Okt 11 20:04 ../
    -rw-r--r-- 1 ncadmin ncadmin 220 Okt 11 20:04 .bash_logout
    -rw-r--r-- 1 root root 829 Okt 11 20:12 .bash_profile
    -rw-r--r-- 1 ncadmin ncadmin 3771 Okt 11 20:04 .bashrc

owner of .bash_profile should be ncadmin:ncadmin

  1. wrong path in .bash_profile

root@nctest3:/home/ncadmin# cat .bash_profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "4.3.46(1)-release" ]
then
# include .bashrc if it exists
if [ -f "/root/.bashrc" ]
then
. "/root/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "/root/bin" ]
then
PATH="/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin"
fi
bash /var/scripts/instruction.sh
bash /var/scripts/history.sh
sudo -i

  • ncadmin has no possibility to test "/root/.bashrc"
  • private bin is ~/bin or /home/ncadmin/bin not /root/bin

this will happen, because of using the HOME Variable in the script change-ncadmin-profile.sh
--> you do it as root!

better: "~/.bashrc"  and  "~/bin"

@eplusk eplusk closed this as completed Oct 12, 2016
@eplusk eplusk reopened this Oct 12, 2016
@enoch85
Copy link
Member

enoch85 commented Oct 12, 2016

Yes, that's a known issue and is happening becuase we fetch the version number from the XML file in the contacts repo. The XML file says that it's 1.5.0.0 but the version is 1.4.0.0. I have pointed this out to the contact devs, and I'm hoping that this will not happen in future versions.

Regarding the .bash_profile, I'll have a look and change it in future versions.

Thanks for your report! Keep 'em coming. :)

@enoch85
Copy link
Member

enoch85 commented Oct 13, 2016

@eplusk can you please test the PR I've created?

@eplusk
Copy link
Author

eplusk commented Oct 14, 2016

@enoch85 Ihave tested the PR, you have to change
$UNIXUSER-PROFILE to $UNIXUSER_PROFILE
then it is ok.
Minus or Underscore is hard to detect

@enoch85
Copy link
Member

enoch85 commented Oct 14, 2016

@eplusk Thanks! Please give your 👍 in the PR before I merge, thanks!

enoch85 pushed a commit that referenced this issue Oct 14, 2016
* chown .bash_profile to correct user as it's created by root

Fixes #44

* change from - to _
WaaromZoMoeilijk pushed a commit that referenced this issue Jul 2, 2017
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

2 participants