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 C1463200C5D for ; Fri, 24 Mar 2017 03:31:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BFB9E160B84; Fri, 24 Mar 2017 02:31:45 +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 1079F160B83 for ; Fri, 24 Mar 2017 03:31:44 +0100 (CET) Received: (qmail 10667 invoked by uid 500); 24 Mar 2017 02:31:44 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 10653 invoked by uid 99); 24 Mar 2017 02:31:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Mar 2017 02:31:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 9B771C315B for ; Fri, 24 Mar 2017 02:31:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Z8SpP4XZO8SP for ; Fri, 24 Mar 2017 02:31:43 +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 A521C5FBA0 for ; Fri, 24 Mar 2017 02:31:42 +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 E9C73E04A8 for ; Fri, 24 Mar 2017 02:31:41 +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 8FEB621DD5 for ; Fri, 24 Mar 2017 02:31:41 +0000 (UTC) Date: Fri, 24 Mar 2017 02:31:41 +0000 (UTC) From: "Genmao Yu (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-14194) Aliyun OSS should not use empty endpoint as default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 24 Mar 2017 02:31:45 -0000 [ https://issues.apache.org/jira/browse/HADOOP-14194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15939587#comment-15939587 ] Genmao Yu commented on HADOOP-14194: ------------------------------------ Good catch! We should expose the real reason. [~xiaobingo] Could you please give a patch? > Aliyun OSS should not use empty endpoint as default > --------------------------------------------------- > > Key: HADOOP-14194 > URL: https://issues.apache.org/jira/browse/HADOOP-14194 > Project: Hadoop Common > Issue Type: Sub-task > Components: fs/oss > Reporter: Mingliang Liu > Assignee: Xiaobing Zhou > > In {{AliyunOSSFileSystemStore::initialize()}}, it retrieves the endPoint and using empty string as a default value. > {code} > String endPoint = conf.getTrimmed(ENDPOINT_KEY, ""); > {code} > The plain value without validation is passed to OSSClient. If the endPoint is not provided (empty string) or the endPoint is not valid, users will get exception from Aliyun OSS sdk with raw exception message like: > {code} > java.lang.IllegalArgumentException: java.net.URISyntaxException: Expected authority at index 8: https:// > at com.aliyun.oss.OSSClient.toURI(OSSClient.java:359) > at com.aliyun.oss.OSSClient.setEndpoint(OSSClient.java:313) > at com.aliyun.oss.OSSClient.(OSSClient.java:297) > at org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystemStore.initialize(AliyunOSSFileSystemStore.java:134) > at org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.initialize(AliyunOSSFileSystem.java:272) > at org.apache.hadoop.fs.aliyun.oss.AliyunOSSTestUtils.createTestFileSystem(AliyunOSSTestUtils.java:63) > at org.apache.hadoop.fs.aliyun.oss.TestAliyunOSSFileSystemContract.setUp(TestAliyunOSSFileSystemContract.java:47) > at junit.framework.TestCase.runBare(TestCase.java:139) > at junit.framework.TestResult$1.protect(TestResult.java:122) > at junit.framework.TestResult.runProtected(TestResult.java:142) > at junit.framework.TestResult.run(TestResult.java:125) > at junit.framework.TestCase.run(TestCase.java:129) > at junit.framework.TestSuite.runTest(TestSuite.java:255) > at junit.framework.TestSuite.run(TestSuite.java:250) > at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84) > at org.junit.runner.JUnitCore.run(JUnitCore.java:160) > at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) > at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51) > at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237) > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) > Caused by: java.net.URISyntaxException: Expected authority at index 8: https:// > at java.net.URI$Parser.fail(URI.java:2848) > at java.net.URI$Parser.failExpecting(URI.java:2854) > at java.net.URI$Parser.parseHierarchical(URI.java:3102) > at java.net.URI$Parser.parse(URI.java:3053) > at java.net.URI.(URI.java:588) > at com.aliyun.oss.OSSClient.toURI(OSSClient.java:357) > {code} > Let's check endPoint is not null or empty, catch the IllegalArgumentException and log it, wrapping the exception with clearer message stating the misconfiguration in endpoint or credentials. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-issues-help@hadoop.apache.org