Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-1365

Do not print stack trace when we can't move generated .java file to CWD

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.3
    • Fix Version/s: 1.4.5
    • Component/s: connectors
    • Labels:
      None

      Description

      The following error is thrown when a sqoop import script is executed:

      DEBUG orm.CompilationManager: Could not rename /tmp/sqoop-abcd/compile/92fa0dd1a081e3540357533bf46b8eae/QueryResult.java to /opt/abcdefgh/ijkl/./QueryResult.java
      java.io.FileNotFoundException: /opt/abcdefgh/ijkl/./QueryResult.java (Permission denied)
              at java.io.FileOutputStream.open(Native Method)
              at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
              at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
              at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:936)
              at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:888)
              at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:835)
              at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2385)
              at org.apache.sqoop.orm.CompilationManager.compile(CompilationManager.java:229)
              at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:97)
              at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:390)
              at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:476)
              at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
              at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
              at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
              at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
              at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
              at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
      

      Just a warning here should be sufficient. There is no need to thrown an exception since it does not affect the flow of the Sqoop import script.

      1. SQOOP-1365.patch
        0.7 kB
        Sai Karthik Ganguru

        Activity

        Hide
        SaiKarthik Sai Karthik Ganguru added a comment -

        You are welcome Jarek.

        Show
        SaiKarthik Sai Karthik Ganguru added a comment - You are welcome Jarek.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1097 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1097/)
        SQOOP-1365: Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee)

        • src/java/org/apache/sqoop/orm/CompilationManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1097 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1097/ ) SQOOP-1365 : Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee ) src/java/org/apache/sqoop/orm/CompilationManager.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #894 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/894/)
        SQOOP-1365: Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee)

        • src/java/org/apache/sqoop/orm/CompilationManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #894 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/894/ ) SQOOP-1365 : Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee ) src/java/org/apache/sqoop/orm/CompilationManager.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #900 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/900/)
        SQOOP-1365: Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee)

        • src/java/org/apache/sqoop/orm/CompilationManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #900 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/900/ ) SQOOP-1365 : Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee ) src/java/org/apache/sqoop/orm/CompilationManager.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #859 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/859/)
        SQOOP-1365: Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee)

        • src/java/org/apache/sqoop/orm/CompilationManager.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #859 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/859/ ) SQOOP-1365 : Do not print stack trace when we can't move generated .java file to CWD (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee ) src/java/org/apache/sqoop/orm/CompilationManager.java
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        The patch is in, thank you for your contribution Sai Karthik Ganguru, greatly appreciated!

        Show
        jarcec Jarek Jarcec Cecho added a comment - The patch is in, thank you for your contribution Sai Karthik Ganguru , greatly appreciated!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee in sqoop's branch refs/heads/trunk from Jarek Jarcec Cecho
        [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=1bc8b6b ]

        SQOOP-1365: Do not print stack trace when we can't move generated .java file to CWD

        (Sai Karthik Ganguru via Jarek Jarcec Cecho)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1bc8b6bfda95f0a6c5cecdf1d2b874e4e22c23ee in sqoop's branch refs/heads/trunk from Jarek Jarcec Cecho [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=1bc8b6b ] SQOOP-1365 : Do not print stack trace when we can't move generated .java file to CWD (Sai Karthik Ganguru via Jarek Jarcec Cecho)
        Hide
        abec Abraham Elmahrek added a comment -

        Sure. That makes sense.

        Show
        abec Abraham Elmahrek added a comment - Sure. That makes sense.
        Hide
        gwenshap Gwen Shapira added a comment -

        Abraham Elmahrek I think the message is useful, but I'm not sure we need the entire stack trace for a message that is basically expected and with known causes.

        Show
        gwenshap Gwen Shapira added a comment - Abraham Elmahrek I think the message is useful, but I'm not sure we need the entire stack trace for a message that is basically expected and with known causes.
        Hide
        gwenshap Gwen Shapira added a comment -

        It is! I closed SQOOP-1360 since this issue actually has the error message.

        Show
        gwenshap Gwen Shapira added a comment - It is! I closed SQOOP-1360 since this issue actually has the error message.
        Hide
        venkatnrangan Venkat Ranganathan added a comment -

        Is this a duplicate of SQOOP-1360?

        Show
        venkatnrangan Venkat Ranganathan added a comment - Is this a duplicate of SQOOP-1360 ?
        Hide
        abec Abraham Elmahrek added a comment -

        How about we print it depending on the verbosity? This kind of information is generally helpful.

        Show
        abec Abraham Elmahrek added a comment - How about we print it depending on the verbosity? This kind of information is generally helpful.
        Hide
        SaiKarthik Sai Karthik Ganguru added a comment -

        Removed the exception being thrown when we DEBUG in VERBOSE mode.

        Show
        SaiKarthik Sai Karthik Ganguru added a comment - Removed the exception being thrown when we DEBUG in VERBOSE mode.
        Hide
        SaiKarthik Sai Karthik Ganguru added a comment -

        Yes I agree. But throwing out an exception (even though it is a DEBUG) might actually not be the rite idea. Please correct me if I am wrong. Anyhow, I have removed the exception being thrown during this DEBUG and attached a patch.

        Show
        SaiKarthik Sai Karthik Ganguru added a comment - Yes I agree. But throwing out an exception (even though it is a DEBUG) might actually not be the rite idea. Please correct me if I am wrong. Anyhow, I have removed the exception being thrown during this DEBUG and attached a patch.
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Just FYI that exception is being printed out as DEBUG, so it's not even WARNING. It will show up if and only if you're running with --verbose mode.

        Show
        jarcec Jarek Jarcec Cecho added a comment - Just FYI that exception is being printed out as DEBUG , so it's not even WARNING . It will show up if and only if you're running with --verbose mode.

          People

          • Assignee:
            SaiKarthik Sai Karthik Ganguru
            Reporter:
            SaiKarthik Sai Karthik Ganguru
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development