threefoldtecharchive / jumpscaleX_archived

Apache License 2.0
1 stars 6 forks source link

test openresty using startupmanager type: corex #708

Closed despiegk closed 5 years ago

despiegk commented 5 years ago
Hamdy commented 5 years ago

I've added a fix for j.servers.corex.test() still working on openresty test

BolaNasr commented 5 years ago

i have error when get openresty to start it ( and test is fail j.servers.openresty.test() ) jumpscaleX ( development_jumpscale) DigitalMeX ( development_jumpscale) image

hossnys commented 5 years ago

i found these two errors on two different installation : old installation with latest changes give me this error :

system: jumpscale.openresty.website.1:29b92dfccd2d8285f9604bfa40dfe806
Tue 23 10:30:51 BCDBMeta.py      - 106 - bcdbmeta                           : save meta:system
Tue 23 10:30:51 BCDB.py          - 373 - bcdb                               : load model:jumpscale.openresty.website.1
Tue 23 10:30:51 BCDBMeta.py      - 158 - bcdbmeta                           : schema set in BCDB:system meta:jumpscale.openres
Tue 23 10:30:51 JSBase.py        - 103 - website                            : ***CLASS INIT 1: website
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 145, in test
    tmux()
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 116, in tmux
    ws.configure()
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/Website.py", line 81, in configure
    j.sal.fs.writeFile("%s/servers/%s.conf" % (self._parent._parent._web_path, self.name), r)
  File "/sandbox/lib/jumpscale/Jumpscale/sal/fs/SystemFSDecorators.py", line 211, in wrapper
    return func(*args, **kwargs)
  File "/sandbox/lib/jumpscale/Jumpscale/sal/fs/SystemFS.py", line 1279, in writeFile
    fp = open(filename, "wb")
FileNotFoundError: [Errno 2] No such file or directory: '/sandbox/var/web/servers/test.conf'

[Errno 2] No such file or directory: '/sandbox/var/web/servers/test.conf'

on a fresh install container this error appeared : Screenshot from 2019-07-23 17-43-31

rkhamis commented 5 years ago

Fixed openresty issues, please verify

hossnys commented 5 years ago

i found this error when i try to test again after pull latest changes |:

{RESET}
Sun 28 08:41:01 JSConfig.py      -  84 - startupcmd                         : trigger: corex_default:save_post
Sun 28 08:41:01 y                - 332 -                                    : iterator was empty for bcdb:system, will rebuild from backend, IS DANGEROUS
Sun 28 08:41:01 JSConfigs.py     - 140 - corexclientfactory                 : get child:'default'from 'corexclientfactory'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 140, in test
    corex()
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 68, in corex
    corex = j.servers.corex.default.client
  File "/sandbox/lib/jumpscale/Jumpscale/servers/corex/CorexServer.py", line 33, in client
    j.clients.corex.default.addr = "localhost"
  File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSConfigs.py", line 314, in __getattr__
    % (name, self._key)
RuntimeError: try to get attribute: 'default', instance did not exist, was also not a method or property, was on 'corexclientfactory'

try to get attribute: 'default', instance did not exist, was also not a method or property, was on 'corexclientfactory'
JSX>  
Pishoy commented 5 years ago

Could not execute: 'bash /tmp/builder_openresty.sh'stderr:

JSX>

rkhamis commented 5 years ago

Verified

hossnys commented 5 years ago

i found this error again when testing openresty :

{RESET}
Sun 28 08:41:01 JSConfig.py      -  84 - startupcmd                         : trigger: corex_default:save_post
Sun 28 08:41:01 y                - 332 -                                    : iterator was empty for bcdb:system, will rebuild from backend, IS DANGEROUS
Sun 28 08:41:01 JSConfigs.py     - 140 - corexclientfactory                 : get child:'default'from 'corexclientfactory'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 140, in test
    corex()
  File "/sandbox/lib/jumpscale/DigitalMe/servers/openresty/OpenRestyFactory.py", line 68, in corex
    corex = j.servers.corex.default.client
  File "/sandbox/lib/jumpscale/Jumpscale/servers/corex/CorexServer.py", line 33, in client
    j.clients.corex.default.addr = "localhost"
  File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSConfigs.py", line 314, in __getattr__
    % (name, self._key)
RuntimeError: try to get attribute: 'default', instance did not exist, was also not a method or property, was on 'corexclientfactory'

try to get attribute: 'default', instance did not exist, was also not a method or property, was on 'corexclientfactory'

and after adding this line

j.clients.corex.new("default")

after line 32 in file : /sandbox/code/github/threefoldtech/jumpscaleX/Jumpscale/servers/corex/CorexServer.py as recommended by @waleedhammam the test passed successfully.