EsharEditor / ambari-hue-service

Ambari stack service for easily installing and managing Hue on HDP cluster
Apache License 2.0
107 stars 68 forks source link

Service startup failed #32

Open whg517 opened 6 years ago

whg517 commented 6 years ago

ENV:

Error log

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.6/services/HUE/package/scripts/hue_server.py", line 76, in <module>
    HueServer().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 329, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.6/services/HUE/package/scripts/hue_server.py", line 28, in start
    self.configure(env)
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 119, in locking_configure
    original_configure(obj, *args, **kw)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.6/services/HUE/package/scripts/hue_server.py", line 23, in configure
    setup_hue()
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.6/services/HUE/package/scripts/setup_hue.py", line 45, in setup_hue
    owner = params.hue_user
  File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 138, in action_create
    sudo.create_file(path, content, encoding=self.resource.encoding)
  File "/usr/lib/python2.6/site-packages/resource_management/core/sudo.py", line 141, in create_file
    fp.write(content)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 3462: ordinal not in range(128)

Once I've modified the code, the HUE service will be started properly using the local package installation. The error message is a character set problem. I have limited ability to find out where it is. I hope I can give you some answers. thank you

My friend told me this was due to a Chinese quotation mark.

“” Quotation marks in Chinese ' The quotation marks are the same in English What should I do?

EsharEditor commented 6 years ago

Hi: file: /usr/lib/python2.6/site-packages/resource_management/core/sudo.py

import sys
reload(sys)
sys.setdefaultencoding('utf-8')
whg517 commented 6 years ago

I will try again later, and I am now installing the tutorial in Hue 3.9 on HDP 2.3, thanks

tangleiNUAA commented 6 years ago

@kiven517 you also can change the code like this:

File(params.hue_server_pid_file,
      action = "delete",
      owner = params.hue_user,
      encoding='utf-8',
    )

This is work on my environment.

whg517 commented 6 years ago

@tangleiNUAA 谢谢你的回答。我根据作者方法,更改了 /usr/lib/python2.6/site-packages/resource_management/core/sudo.py 这个文件。能够成功运行。