Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 78A77200CB4 for ; Tue, 27 Jun 2017 14:15:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 77241160BE9; Tue, 27 Jun 2017 12:15:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BE8FB160BDC for ; Tue, 27 Jun 2017 14:15:05 +0200 (CEST) Received: (qmail 20526 invoked by uid 500); 27 Jun 2017 12:15:05 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 20517 invoked by uid 99); 27 Jun 2017 12:15:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2017 12:15:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 094021802CA for ; Tue, 27 Jun 2017 12:15:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.001 X-Spam-Level: X-Spam-Status: No, score=-100.001 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id tqdFtAkXCAov for ; Tue, 27 Jun 2017 12:15:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id A280B5FE1F for ; Tue, 27 Jun 2017 12:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0DFFCE0DD0 for ; Tue, 27 Jun 2017 12:15:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 75AE52413D for ; Tue, 27 Jun 2017 12:15:00 +0000 (UTC) Date: Tue, 27 Jun 2017 12:15:00 +0000 (UTC) From: "David Kaspar (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMBARI-21355) Upgrade to Ambari Server 2.5.1 breaks common-services provided by MPacks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 27 Jun 2017 12:15:06 -0000 David Kaspar created AMBARI-21355: ------------------------------------- Summary: Upgrade to Ambari Server 2.5.1 breaks common-services provided by MPacks Key: AMBARI-21355 URL: https://issues.apache.org/jira/browse/AMBARI-21355 Project: Ambari Issue Type: Bug Components: ambari-server, ambari-upgrade Affects Versions: 2.5.0 Environment: Ubuntu Linux 14.04 Reporter: David Kaspar *How to reproduce:* * Have your own MPack that is similar to one that is located at "contrib/management-packs/microsoft-r_mpack" in Ambari source code * Have an Ambari Server 2.4.3 with the MPack installed in a cluster * Upgrade Ambari-Server to 2.5.1 version *Expected Behavior:* Ambari Server is upgraded and MPack is still installed and used *Actual Behavior:* When running {{ambari-server upgrade}}, it fails with the following error message: {code} Using python /usr/bin/python Upgrading ambari-server INFO: Upgrade Ambari Server INFO: Updating Ambari Server properties in ambari.properties ... INFO: Updating Ambari Server properties in ambari-env.sh ... WARNING: Original file ambari-env.sh kept ERROR: Unexpected OSError: [Errno 17] File exists For more info run ambari-server with -v or --verbose option {code} *The following steps are used for Ambari-Server upgrade:* {code} service ambari-server stop ambari-agent stop wget -nv http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.5.1.0/ambari.list -O /etc/apt/sources.list.d/ambari.list apt-get clean all apt-get update apt-get install ambari-server apt-get install ambari-agent ambari-server upgrade {code} *Analyses:* Usually when such a common service is installed from MPack, a new directory (named by the service) is created in {{/var/lib/ambari-server/resources/common-services/}} directory. The service directory contain a single symbolic link (named by the version of the service) and targets {{/var/lib/ambari-server/resources/mpacks/-/common-services//}} It seems that the whole upgrade process works correctly until {code}ambari-server upgrade{code} command runs {{find_and_copy_custom_services}} function that re-creates common-services from the backup directory that is created during {{apt-get install ambari-server}}. The backup directory is correctly having the symbolic link in it while the newly created {{/var/lib/ambari-server/resources/common-services/}} is NOT having the symbolic link. Instead it contains full-deep copy of the directory targeted by the original symbolic link. *Proposed Solution:* Replace the following line in {{ambari-server/src/main/python/ambari_server/serverUpgrade.py}}: {code} shutil.copytree(backup_service, os.path.join(current_base_service_dir,service_name)) {code} with: {code} shutil.copytree(backup_service, os.path.join(current_base_service_dir,service_name), True) {code} so the service directory gets copied while keeping symbolic links. -- This message was sent by Atlassian JIRA (v6.4.14#64029)