EthanZhang1997 opened a new issue #5600:
URL: https://github.com/apache/dolphinscheduler/issues/5600


   **Describe the question**
   I set resourceStorageType="NONE" in the install_config.conf and tried to use 
resource upload function. 
   
   Here is the error occured in web UI.
   
![api](https://user-images.githubusercontent.com/78401974/121110643-35bd6980-c840-11eb-92be-70f0d80d6afb.png)
   
   I've set defaultFS with my local file system in install_config.conf but it 
didn't work. After debugging I found the init() method in HadoopUtils class.
   
![init1](https://user-images.githubusercontent.com/78401974/121111562-ae70f580-c841-11eb-9f8d-57a6c0889017.png)
   
![init2](https://user-images.githubusercontent.com/78401974/121111570-b03ab900-c841-11eb-8cd7-f2f504254b92.png)
   
   This method reads resourceStorageType firstly and it only supports HDFS and 
S3. But if anybody wants to use local file system, the prerequisite is to set 
resourceStorageType="HDFS". If not, fs will be null and cause 
NullPointerException.
   
![error](https://user-images.githubusercontent.com/78401974/121112462-05c39580-c843-11eb-9738-9674ab117863.png)
   
   **What are the current deficiencies and the benefits of improvement**
   
   The if-else_if block which handles with resourceStorageType doesn't ends 
with else{} so if its value is "NONE", fs will be null. It is obviously 
inappropriate. There would be plenty of NullPointerExceptions. 
   
   **Which version of DolphinScheduler:**
   1.3.5-release
   
   **Describe alternatives you've considered**
   I think when resourceStorageType = "NONE", we should judge whether defaultFS 
has been set in the config, e.g. local file system. Or if user doesn't want to 
use resource upload function and does't set FS. We should give fs a value or 
handle it in every method which uses fs. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to