zatosource / zato

ESB, SOA, REST, APIs and Cloud Integrations in Python
https://zato.io
GNU Affero General Public License v3.0
1.12k stars 240 forks source link

Error on "zato create user" #1120

Closed x011 closed 3 years ago

x011 commented 3 years ago
[zato@static ~]$ zato create user /opt/zato/lob/web-admin --verbose
File "/opt/zato/current/bin/zato", line 16, in <module>
    sys.exit(main())
  File "/opt/zato/3.2.0/code/zato-cli/src/zato/cli/zato_command.py", line 569, in main
    return run_command(args)
  File "/opt/zato/3.2.0/code/zato-cli/src/zato/cli/__init__.py", line 394, in run_command
    return instance.run(args)
  Traceback (most recent call last):
  File "/opt/zato/3.2.0/code/zato-cli/src/zato/cli/__init__.py", line 761, in run
    self.before_execute(args)
  File "/opt/zato/3.2.0/code/zato-cli/src/zato/cli/web_admin_auth.py", line 80, in before_execute
    self._prepare(args)
  File "/opt/zato/3.2.0/code/zato-cli/src/zato/cli/web_admin_auth.py", line 29, in _prepare
    config = loads(open(os.path.join(base_dir, '.', 'config/repo/web-admin.conf')).read())
FileNotFoundError: [Errno 2] No such file or directory: '/opt/zato/lob/web-admin/./config/repo/web-admin.conf'

seems that "zato create user" adds a dot (relative path) after the specific path '/opt/zato/lob/web-admin/HERE-->./config/repo/web-admin.conf'

dsuch commented 3 years ago

Hi @x011,

the dot looks to be harmless although you are right that it does not need to be displayed. Please consider the case below:

$ cd /./tmp/./

This is the same as plain "cd /tmp" despite the dots. That makes me wonder, does the /opt/zato/lob directory truly exist?

Regards.

x011 commented 3 years ago

Yes, it does exist:

[root@static lob]# pwd
/opt/zato/lob
dsuch commented 3 years ago

Which part of this path does not exist in this case? '/opt/zato/lob/web-admin/./config/repo/web-admin.conf'

x011 commented 3 years ago

I'm following the example provided on https://zato.io/docs/web-admin/security.html As a first time ZATO user , I've been founding to many errors and probably won't continue using ZATO. Thank you anyway.