Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check & build failed (linux-musl) #28

Open
quuc opened this issue Nov 5, 2021 · 42 comments
Open

check & build failed (linux-musl) #28

quuc opened this issue Nov 5, 2021 · 42 comments

Comments

@quuc
Copy link

quuc commented Nov 5, 2021

Describe the bug
A clear and concise description of what the bug is.

I had some problems with the check & build process.
cargo check 的过程中报错了。
报错内容跟 delicate-utils 的依赖 poem 有关。

[root@2cb22c0d29ba delicate]# cargo check
   Compiling delicate-scheduler v0.1.0 (/delicate/delicate-scheduler)
    Checking delicate-utils v0.1.0 (/delicate/delicate-utils)
error[E0599]: the method `as_dyn_error` exists for reference `&ParseCookieError`, but its trait bounds were not sati
sfied
   --> delicate-utils/src/error.rs:28:13
    |
28  |     #[error("Parse Cookie fail.")]
    |             ^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&ParseCookieError` due to unsatisfied trait bound
s
    |
   ::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/poem-1.0.19/src/error.rs:253:1
    |
253 | pub enum ParseCookieError {
    | -------------------------
    | |
    | doesn't satisfy `ParseCookieError: AsDynError`
    | doesn't satisfy `ParseCookieError: StdError`
    |
    = note: the following trait bounds were not satisfied:
            `ParseCookieError: StdError`
            which is required by `ParseCookieError: AsDynError`
            `&ParseCookieError: StdError`
            which is required by `&ParseCookieError: AsDynError`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `delicate-utils` due to previous error

I tested it in docker environment.
我分别用了 rust:alpine 和 rust:latest 来测试,结果都出现了一样的错误。

To Reproduce
Steps to reproduce the behavior:

1.install docker

apt install docker.io

2.pull & run rust:alpine (x86_64-unknown-linux-musl)

docker run -it --name rs-musl rust:alpine

3.git clone this repo

git clone --depth=1 https://github.com/BinChengZhao/delicate

4.copy env file

cd delicate
cp template.env .env

5.install deps

apk update
apk add mariadb-dev postgresql-dev openssl-dev musl-dev

6.run cargo command

cargo check

7.error (unsatisfied trait bounds)

   --> delicate-utils/src/error.rs:28:13
    |
28  |     #[error("Parse Cookie fail.")]
    |             ^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&ParseCookieError` due to unsatisfied trait bounds

8.exit this container and run rust:latest (x86_64-unknown-linux-gnu)

docker run -it --name rs-stable rust:latest

9.run container & check deps

docker exec -it rs-stable bash
apt list --installed | grep -E "mysql|mariadb|libssl|libpq"
default-libmysqlclient-dev/now 1.0.7 amd64 [installed,local]
libmariadb-dev-compat/now 1:10.5.12-0+deb11u1 amd64 [installed,local]
libmariadb-dev/now 1:10.5.12-0+deb11u1 amd64 [installed,local]
libmariadb3/now 1:10.5.12-0+deb11u1 amd64 [installed,local]
libpq-dev/now 13.4-0+deb11u1 amd64 [installed,local]
libpq5/now 13.4-0+deb11u1 amd64 [installed,local]
libssl-dev/now 1.1.1k-1+deb11u1 amd64 [installed,local]
libssl1.1/now 1.1.1k-1+deb11u1 amd64 [installed,local]
mariadb-common/now 1:10.5.12-0+deb11u1 all [installed,local]
mysql-common/now 5.8+1.0.7 all [installed,local]
  1. copy env file & cargo check

I encountered the same error as the alpine (rust musl) container.

Expected behavior
A clear and concise description of what you expected to happen.

1.我想要在 alpine 容器里运行delicate。
I want to run it in a musl environment.

2.我希望开发者能提供预编译的版本。
这样子普通用户就不用操心编译的事情了。

I would like to get the musl binary on the release page.

3.我希望核心配置能在编译后进行修改,而不是重新配置,重新编译。
I would like to be able to change the configuration after compilation rather than recompile it with an .env file.

For example,
template-env.toml

[database]
# pssql or mysql
backend = "postgre"
url = "..."

[redis]
enabled = true

# IP address or hostname
host = "redis-docker"

port = 6379
passwd = "ItIsRedisPassword"

Screenshots

2021-11-05 09 38 25

@quuc quuc changed the title musl check & build failed check & build failed (linux-musl) Nov 5, 2021
@BinChengZhao
Copy link
Owner

@cu233

Thank you so much for your use & feedback!

The specific problem has been pinpointed because poem had a breaking change and needed all downstream dependencies to be actively compatible.

I've fixed it.

Your requirements are very reasonable, I will record them in the roadmap one by one, because I am still writing the new feature actuator, and probably the requirements will be finished by early 2022.

If you have time, I hope you can contribute to delicate, for example by creating a docker image, it would be my pleasure if you have the chance.

如果你能参与进来,这将是我的荣幸。

We can use the github-discuss feature to discuss the future of the project asynchronously and contribute to the Rust ecosystem together.

@makorne
Copy link

makorne commented Nov 7, 2021

I've fixed it.

Looks the issue is still alive :)

I`ve just tried to build V1.31, #https://github.com/BinChengZhao/delicate/releases/tag/V1.3.1 with poem 1.0.22 (bump 1.05 in utils cargo.toml) :

error[E0599]: the method `as_dyn_error` exists for reference `&ParseCookieError`, but its trait bounds were not satisfied
   --> delicate-utils/src/error.rs:28:13
    |
28  |     #[error("Parse Cookie fail.")]
    |             ^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&ParseCookieError` due to unsatisfied trait bounds
    |
   ::: /home/f/.cargo/registry/src/github.com-1ecc6299db9ec823/poem-1.0.22/src/error.rs:253:1
    |
253 | pub enum ParseCookieError {
    | -------------------------
    | |
    | doesn't satisfy `ParseCookieError: AsDynError`
    | doesn't satisfy `ParseCookieError: StdError`
    |
    = note: the following trait bounds were not satisfied:
            `ParseCookieError: StdError`
            which is required by `ParseCookieError: AsDynError`
            `&ParseCookieError: StdError`
            which is required by `&ParseCookieError: AsDynError`

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 7, 2021

I've fixed it.

Looks the issue is still alive :)

I`ve just tried to build V1.31, #https://github.com/BinChengZhao/delicate/releases/tag/V1.3.1 with poem 1.0.22 (bump 1.05 in utils cargo.toml) :

error[E0599]: the method `as_dyn_error` exists for reference `&ParseCookieError`, but its trait bounds were not satisfied
   --> delicate-utils/src/error.rs:28:13
    |
28  |     #[error("Parse Cookie fail.")]
    |             ^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&ParseCookieError` due to unsatisfied trait bounds
    |
   ::: /home/f/.cargo/registry/src/github.com-1ecc6299db9ec823/poem-1.0.22/src/error.rs:253:1
    |
253 | pub enum ParseCookieError {
    | -------------------------
    | |
    | doesn't satisfy `ParseCookieError: AsDynError`
    | doesn't satisfy `ParseCookieError: StdError`
    |
    = note: the following trait bounds were not satisfied:
            `ParseCookieError: StdError`
            which is required by `ParseCookieError: AsDynError`
            `&ParseCookieError: StdError`
            which is required by `&ParseCookieError: AsDynError`

@makorne
Sorry, it's because I didn't hit tag in time before, this fix can be reflected on master,

thanks for your feedback! Can using V1.3.2 now ~
:)

@makorne
Copy link

makorne commented Nov 8, 2021

Thank you!

I checked it having set all your .delicate-rs.com domains to localhost.

But still infinite LOADING ( although I turned off cors).
api/user/check responded Unauthorized but no login form loads.

Checked with curl:

curl 'http://api-local.delicate-rs.com:8090/api/user/check' \
  -X 'POST' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 0' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' \
  -H 'Origin: http://delicate-rs.com:8000' \
  -H 'Referer: http://delicate-rs.com:8000/' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  --compressed -v
*   Trying 127.0.0.1:8090...
* Connected to api-local.delicate-rs.com (127.0.0.1) port 8090 (#0)
> POST /api/user/check HTTP/1.1
> Host: api-local.delicate-rs.com:8090
> Accept-Encoding: deflate, gzip, br
> Connection: keep-alive
> Content-Length: 0
> Accept: application/json, text/plain, */*
> User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
> Origin: http://delicate-rs.com:8000
> Referer: http://delicate-rs.com:8000/
> Accept-Language: en-US,en;q=0.9
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< content-length: 0
< date: Mon, 08 Nov 2021 04:13:37 GMT
< 
* Connection #0 to host api-local.delicate-rs.com left intact

I dont understand how you can develop it on your laptop :)

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 8, 2021

Thank you!

I checked it having set all your .delicate-rs.com domains to localhost.

But still infinite LOADING ( although I turned off cors). api/user/check responded Unauthorized but no login form loads.

Checked with curl:

curl 'http://api-local.delicate-rs.com:8090/api/user/check' \
  -X 'POST' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 0' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' \
  -H 'Origin: http://delicate-rs.com:8000' \
  -H 'Referer: http://delicate-rs.com:8000/' \
  -H 'Accept-Language: en-US,en;q=0.9' \
  --compressed -v
*   Trying 127.0.0.1:8090...
* Connected to api-local.delicate-rs.com (127.0.0.1) port 8090 (#0)
> POST /api/user/check HTTP/1.1
> Host: api-local.delicate-rs.com:8090
> Accept-Encoding: deflate, gzip, br
> Connection: keep-alive
> Content-Length: 0
> Accept: application/json, text/plain, */*
> User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36
> Origin: http://delicate-rs.com:8000
> Referer: http://delicate-rs.com:8000/
> Accept-Language: en-US,en;q=0.9
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< content-length: 0
< date: Mon, 08 Nov 2021 04:13:37 GMT
< 
* Connection #0 to host api-local.delicate-rs.com left intact

I dont understand how you can develop it on your laptop :)

I've helped a few community friends build before, and basically there are fewer obstacles, so let me determine what the problem is.

First, let me share my local situation: the

web-local.delicate-rs.com
api-local.delicate-rs.com

Adjust the .env (delicate-schduler) configuration, adjust delicate-web/.env
and delicate-web/src/utils/envConfig.js.

You can try visiting the address

http://{your domain}/api/tasks_state/one_day
In your browser.
(Example: http://api.delicate-rs.com:8090/api/tasks_state/one_day)

If the server side corresponds properly, check delicate-web, check the configuration I mentioned above, you can temporarily change the local (delicate-web/src/utils/envConfig.js.) environment addresses to your own local address first.

@makorne
Copy link

makorne commented Nov 8, 2021

I just try using your setting, so my hosts file has
127.0.0.1 www.delicate.com api.delicate.com delicate.com api-local.delicate.com api-local.delicate-rs.com delicate-rs.com web-local.delicate-rs.com

http://api-local.delicate-rs.com:8090/api/tasks_state/one_day gives a good response :
{"code":-1,"msg":"Please log in and operate.","data":null}

.env:

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=web-local.delicate-rs.com

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=web-local.delicate-rs.com

# Customized scheduler name.
# Required
SCHEDULER_NAME=

# Listening address of the scheduler service.
# Required
SCHEDULER_LISTENING_ADDRESS=0.0.0.0:8090

delicate-web/src/utils/envConfig.js.

const env = process.env.NODE_ENV

const envConfig = {
  development: {
    // Auto set by ci.
    DELICATE_API: 'http://api-local.delicate-rs.com:8090',
    DELICATE_WEB: 'http://web-local.delicate-rs.com:7000'
  },
  test: {
    DELICATE_API: 'http://52.78.161.159:8090',
    DELICATE_WEB: 'http://localhost:3001'
  },
  production: {
    DELICATE_API: 'http://api.delicate-rs.com',
    DELICATE_WEB: 'http://localhost:3001'
  }
}
export default (key) => envConfig[env][key]

http://api-local.delicate-rs.com:8090/api/user/check responded:
,"msg":"Please log in and operate.","data":null}
but there is no login form

Delicate_Screenshot_2021-11-08_13-28-44

@BinChengZhao
Copy link
Owner

Customized scheduler domain.

Required

SCHEDULER_DOMAIN=web-local.delicate-rs.com

Customized scheduler-front-end domain.

Required

Setting this item makes it easier to handle cross-domain issues.

SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

Customized cookie-domain domain.

e.g delicate.com

Required

SCHEDULER_COOKIE_DOMAIN=web-local.delicate-rs.com

Customized scheduler name.

Required

SCHEDULER_NAME=

Listening address of the scheduler service.

Required

SCHEDULER_LISTENING_ADDRESS=0.0.0.0:8090

Set to the domain name of your local scheduler

SCHEDULER_DOMAIN=http://api-local.delicate-rs.com

Set to the domain name of your local front-end

SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

Set to your local cookie-domain

SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

The delicate-web front-end service should be, accessed via its own domain name e.g. web-local.delicate-rs.com

Because the browser requires it to be at delicate-rs.com with api-**

@BinChengZhao
Copy link
Owner

I just try using your setting, so my hosts file has 127.0.0.1 www.delicate.com api.delicate.com delicate.com api-local.delicate.com api-local.delicate-rs.com delicate-rs.com web-local.delicate-rs.com

http://api-local.delicate-rs.com:8090/api/tasks_state/one_day gives a good response : {"code":-1,"msg":"Please log in and operate.","data":null}

.env:

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=web-local.delicate-rs.com

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=web-local.delicate-rs.com

# Customized scheduler name.
# Required
SCHEDULER_NAME=

# Listening address of the scheduler service.
# Required
SCHEDULER_LISTENING_ADDRESS=0.0.0.0:8090

delicate-web/src/utils/envConfig.js.

const env = process.env.NODE_ENV

const envConfig = {
  development: {
    // Auto set by ci.
    DELICATE_API: 'http://api-local.delicate-rs.com:8090',
    DELICATE_WEB: 'http://web-local.delicate-rs.com:7000'
  },
  test: {
    DELICATE_API: 'http://52.78.161.159:8090',
    DELICATE_WEB: 'http://localhost:3001'
  },
  production: {
    DELICATE_API: 'http://api.delicate-rs.com',
    DELICATE_WEB: 'http://localhost:3001'
  }
}
export default (key) => envConfig[env][key]

http://api-local.delicate-rs.com:8090/api/user/check responded: ,"msg":"Please log in and operate.","data":null} but there is no login form

Delicate_Screenshot_2021-11-08_13-28-44

Set to the domain name of your local scheduler

SCHEDULER_DOMAIN=http://api-local.delicate-rs.com

Set to the domain name of your local front-end

SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

Set to your local cookie-domain

SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

The delicate-web front-end service should be, accessed via its own domain name e.g. web-local.delicate-rs.com

Because the browser requires it to be at delicate-rs.com with api-*

@makorne
Copy link

makorne commented Nov 8, 2021

Sorry but this changed nothing.

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=http://api-local.delicate-rs.com

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

Delicate_Screenshot_2021-11-08_14-18-34

@BinChengZhao
Copy link
Owner

Sorry but this changed nothing.

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=http://api-local.delicate-rs.com

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

Delicate_Screenshot_2021-11-08_14-18-34

This is the first time I've encountered your situation.

Did you configure your front-end project with a domain name (the front-end must have its own domain name and be under the same domain as the api, e.g. a.delicate-rs.com b.delicate-rs.com)?

Are you accessing the service through the domain name? (It can't be localhost)

Have you modified the delicate code?

@makorne
Copy link

makorne commented Nov 8, 2021

Now frontend is http://web-local.delicate-rs.com:7000/
This url is opened in chrome and firefox on screenshots.

I did not modify the code, only add

    let cors = Cors::new()
        .allow_origin(&scheduler_front_end_domain)
//added:        
        .allow_origin("api-local.delicate-rs.com:8090")
        .allow_origin("delicate-rs.com:8000")
        .allow_origin("web-local.delicate-rs.com:7000")
        .allow_origin("*")
//

@BinChengZhao
Copy link
Owner

Now frontend is http://web-local.delicate-rs.com:7000/ This url is opened in chrome and firefox on screenshots.

I did not modify the code, only add

    let cors = Cors::new()
        .allow_origin(&scheduler_front_end_domain)
//added:        
        .allow_origin("api-local.delicate-rs.com:8090")
        .allow_origin("delicate-rs.com:8000")
        .allow_origin("web-local.delicate-rs.com:7000")
        .allow_origin("*")
//

You're almost there.

Just configure a proxy for the front end (apache or nginx will do), the domain name of the front end cannot have a port number

You must use . ***.delicate-rs.com

Then, the code in delicate can be restored!

@makorne
Copy link

makorne commented Nov 8, 2021

Ok, lets try nginx proxy

But nginx crashed with the example from your readme:

        # Proxy delicate-scheduler server .
		location /api {
            proxy_set_header   X-Forwarded-For $remote_addr;
            proxy_set_header   Host $http_host;
            proxy_pass         http://*.*.*.*:8090;
        }
status nginx.service
× nginx.service - The nginx HTTP and reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2021-11-08 16:42:42 +07; 4s ago
    Process: 763445 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
    Process: 763446 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
        CPU: 21ms

Nov 08 16:42:42 fedora systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 08 16:42:42 fedora nginx[763446]: nginx: [emerg] host not found in upstream "*.*.*.*" in /etc/nginx/nginx.conf:69
Nov 08 16:42:42 fedora nginx[763446]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 08 16:42:42 fedora systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 08 16:42:42 fedora systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 08 16:42:42 fedora systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

nginx version: nginx/1.20.1

@BinChengZhao
Copy link
Owner

Ok, lets try nginx proxy

But nginx crashed with the example from your readme:

        # Proxy delicate-scheduler server .
		location /api {
            proxy_set_header   X-Forwarded-For $remote_addr;
            proxy_set_header   Host $http_host;
            proxy_pass         http://*.*.*.*:8090;
        }
status nginx.service
× nginx.service - The nginx HTTP and reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Mon 2021-11-08 16:42:42 +07; 4s ago
    Process: 763445 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
    Process: 763446 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
        CPU: 21ms

Nov 08 16:42:42 fedora systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 08 16:42:42 fedora nginx[763446]: nginx: [emerg] host not found in upstream "*.*.*.*" in /etc/nginx/nginx.conf:69
Nov 08 16:42:42 fedora nginx[763446]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 08 16:42:42 fedora systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 08 16:42:42 fedora systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 08 16:42:42 fedora systemd[1]: Failed to start The nginx HTTP and reverse proxy server.

nginx version: nginx/1.20.1

This example does have a bit of a threshold (it assumes the deployer has a lot of experience building front- and back-ends, and I'll try to do a docker version with binary distribution later.)
The readme example uses a static web file + a backend configuration of the same domain.

And *. *. *. * is just a placeholder needed to put your own remote machine ip.

Forget about that!
I'll give you a shortcut.

You just need to set up a proxy for front-end (delicate-web) and that's it.
https://www.tecmint.com/nginx-as-reverse-proxy-for-nodejs-app/

@makorne
Copy link

makorne commented Nov 8, 2021

I think you can add a comment about this placeholder in the example.

Hurrach!!
We have the same result over nginx proxy. :)

Delicate_Screenshot_2021-11-08_17-59-05

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 8, 2021

I think you can add a comment about this placeholder in the example.

The path of your front-end request is web-local.delicate-rs.com:8899,

This does not work, it must be web-local.delicate-rs.com without the port number.
Because the appended port will be considered as a separate source.

Then after the changes, please paste out your configuration and I will check it.

@makorne
Copy link

makorne commented Nov 9, 2021

Bingo!

Strange but looks like it works only on 80 port!
I think it is better to add the info about this to the example and what to do for https on port 443.

Delicate_Screenshot_2021-11-09_15-26-03

But for some reason default credentials admin/admin do not change anything.
No error and no dashboard.

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 9, 2021

Bingo!

Strange but looks like it works only on 80 port! I think it is better to add the info about this to the example and what to do for https on port 443.

Delicate_Screenshot_2021-11-09_15-26-03

But for some reason default credentials admin/admin do not change anything. No error and no dashboard.

I see, it may be that your local cookie cannot be written, please check the cookie related configuration.

In fact, port 443 is also available, but currently there is no access to rusttls ~ is adding Grpc and a little user-friendly features, the future will add on.

@makorne
Copy link

makorne commented Nov 9, 2021

I checked - 677Mb with different cookies and sites data
Removed yesterday`s cookie from delicate-rs.com
And now Hurrah I get error message!!!

Delicate_Screenshot_2021-11-09_16-24-20

Cookies exist:
Delicate_Screenshot_2021-11-09_16-30-50

is adding Grpc

You have just migrated from actix to poem... And plan to migrate again to tonic?

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 9, 2021

I checked - 677Mb with different cookies and sites data Removed yesterday`s cookie from delicate-rs.com And now Hurrah I get error message!!!

Delicate_Screenshot_2021-11-09_16-24-20

Cookies exist: Delicate_Screenshot_2021-11-09_16-30-50

is adding Grpc

You have just migrated from actix to poem... And plan to migrate again to tonic?

I have a few questions, your local service should be api-local.delicate-rs.com, right?

But the screenshot shows that you are calling api.delicate-rs.com,

The local cookie exists probably because you visited my service web.delicate-rs.com && api.delicate-rs.com yesterday, or your local front-end domain called my service on the public web (which is a mismatch, local should call local services), and they were left behind.

It's convenient to paste your local front and back end domains, with .env and EnvConfig.js, I take a look.

And Delicate doesn't remove Poem, relying on Tonic just adds a centralized scheduling method.

It is currently a weakly centralized scheduling model.

@makorne
Copy link

makorne commented Nov 9, 2021

Anyway api.delicate-rs.com pointed to my localhost
hosts: 127.0.0.1 www.delicate.com api.delicate.com delicate.com api-local.delicate.com api.delicate-rs.com api-local.delicate-rs.com delicate-rs.com web-local.delicate-rs.com

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=http://api.delicate-rs.com:8090

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

# Customized scheduler name.
# Required
SCHEDULER_NAME=

# Listening address of the scheduler service.
# Required
SCHEDULER_LISTENING_ADDRESS=0.0.0.0:8090

# Listening address of the executor service.
# Required
EXECUTOR_LISTENING_ADDRESS=0.0.0.0:9080
const envConfig = {
  development: {
    // Auto set by ci.
    DELICATE_API: 'http://api-local.delicate-rs.com:8090',
    DELICATE_WEB: 'http://web-local.delicate-rs.com:7000'
  },
  test: {
    DELICATE_API: 'http://52.78.161.159:8090',
    DELICATE_WEB: 'http://localhost:3001'
  },
  production: {
    DELICATE_API: 'http://api.delicate-rs.com:8090',
    DELICATE_WEB: 'http://localhost:3001'
  }
}

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 9, 2021

Anyway api.delicate-rs.com pointed to my localhost hosts: 127.0.0.1 www.delicate.com api.delicate.com delicate.com api-local.delicate.com api.delicate-rs.com api-local.delicate-rs.com delicate-rs.com web-local.delicate-rs.com

# Customized scheduler domain.
# Required
SCHEDULER_DOMAIN=http://api.delicate-rs.com:8090

# Customized scheduler-front-end domain.
# Required
# Setting this item makes it easier to handle cross-domain issues.
SCHEDULER_FRONT_END_DOMAIN=http://web-local.delicate-rs.com

# Customized cookie-domain domain.
# e.g `delicate.com`
# Required
SCHEDULER_COOKIE_DOMAIN=delicate-rs.com

# Customized scheduler name.
# Required
SCHEDULER_NAME=

# Listening address of the scheduler service.
# Required
SCHEDULER_LISTENING_ADDRESS=0.0.0.0:8090

# Listening address of the executor service.
# Required
EXECUTOR_LISTENING_ADDRESS=0.0.0.0:9080
const envConfig = {
  development: {
    // Auto set by ci.
    DELICATE_API: 'http://api-local.delicate-rs.com:8090',
    DELICATE_WEB: 'http://web-local.delicate-rs.com:7000'
  },
  test: {
    DELICATE_API: 'http://52.78.161.159:8090',
    DELICATE_WEB: 'http://localhost:3001'
  },
  production: {
    DELICATE_API: 'http://api.delicate-rs.com:8090',
    DELICATE_WEB: 'http://localhost:3001'
  }
}

Please set SCHEDULER_NAME, this parameter is very important

Do you report an error when you start delicatete?

Please restart delicate-schduler after setting

@makorne
Copy link

makorne commented Nov 9, 2021

No errors... Try empty SCHEDULER_NAME.

Ok lets try SCHEDULER_NAME=THEBEST

YEEEES!
THEBEST loads dashboard!!!

Thank you for your GREAT help!!!!

@BinChengZhao
Copy link
Owner

No errors... Try empty SCHEDULER_NAME.

Ok lets try SCHEDULER_NAME=THEBEST

YEEEES! THEBEST loads dashboard!!!

Thank you for your GREAT help!!!!

Being able to help you @makorne with this one has been the most fun I've had lately.

If there are any more questions I will be there to support as soon as I see them.

: )

@makorne
Copy link

makorne commented Nov 10, 2021

Created task:

Delicate_Screenshot_2021-11-10_10-13-46

Execute task (ls -la;) -> Success

Delicate_Screenshot_2021-11-10_09-33-48

View task log -> Empty

Delicate_Screenshot_2021-11-10_09-34-48

executor:

Nov 10 09:11:16.519  INFO main poem::server: listening addr=socket://0.0.0.0:9080
Nov 10 09:11:16.519  INFO main poem::server: server started
Nov 10 09:28:59.795  INFO executor-0 bind_executor{bind_scheduler="scheduler_host:http://api.delicate-rs.com:8090 executor_processor_id:1 executor_processor_host:0.0.0.0:9080 executor_processor_name:Local executor_machine_id:1 time:1636511339"}: delicate_executor: scheduler_host:http://api.delicate-rs.com:8090 executor_processor_id:1 executor_processor_host:0.0.0.0:9080 executor_processor_name:Local executor_machine_id:1 time:1636511339
Nov 10 09:29:06.398  INFO executor-9 health_screen{time=1636511346}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511346
Nov 10 09:29:26.395  INFO executor-0 health_screen{time=1636511366}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511366
Nov 10 09:29:46.398  INFO executor-9 health_screen{time=1636511386}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511386
Nov 10 09:30:06.396  INFO executor-9 health_screen{time=1636511406}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511406
Nov 10 09:30:26.398  INFO executor-9 health_screen{time=1636511426}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511426
Nov 10 09:30:46.398  INFO executor-9 health_screen{time=1636511446}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511446
Nov 10 09:31:06.398  INFO executor-9 health_screen{time=1636511466}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511466

Why is executing successfull and task log is empty ???

@BinChengZhao
Copy link
Owner

Created task:

Delicate_Screenshot_2021-11-10_10-13-46

Execute task (ls -la;) -> Success

Delicate_Screenshot_2021-11-10_09-33-48

View task log -> Empty

Delicate_Screenshot_2021-11-10_09-34-48

executor:

Nov 10 09:11:16.519  INFO main poem::server: listening addr=socket://0.0.0.0:9080
Nov 10 09:11:16.519  INFO main poem::server: server started
Nov 10 09:28:59.795  INFO executor-0 bind_executor{bind_scheduler="scheduler_host:http://api.delicate-rs.com:8090 executor_processor_id:1 executor_processor_host:0.0.0.0:9080 executor_processor_name:Local executor_machine_id:1 time:1636511339"}: delicate_executor: scheduler_host:http://api.delicate-rs.com:8090 executor_processor_id:1 executor_processor_host:0.0.0.0:9080 executor_processor_name:Local executor_machine_id:1 time:1636511339
Nov 10 09:29:06.398  INFO executor-9 health_screen{time=1636511346}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511346
Nov 10 09:29:26.395  INFO executor-0 health_screen{time=1636511366}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511366
Nov 10 09:29:46.398  INFO executor-9 health_screen{time=1636511386}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511386
Nov 10 09:30:06.396  INFO executor-9 health_screen{time=1636511406}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511406
Nov 10 09:30:26.398  INFO executor-9 health_screen{time=1636511426}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511426
Nov 10 09:30:46.398  INFO executor-9 health_screen{time=1636511446}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511446
Nov 10 09:31:06.398  INFO executor-9 health_screen{time=1636511466}: delicate_executor: From: socket://127.0.0.1:43252, Request-time:time:1636511466

Why is executing successfull and task log is empty ???

Because you don't bind an executor to the task.
Your bingding node is empty.

doc:
https://delicate-rs.github.io/entries.html#task

@makorne
Copy link

makorne commented Nov 10, 2021

But it does not have the required * in the form.

And I tried before with node 1 with the same result.

Ok, I found how to do it!!

Hurrah!!!
Something in Chinese, looks like completed!

Delicate_Screenshot_2021-11-10_12-42-20

Thank you!

@BinChengZhao
Copy link
Owner

But it does not have the required * in the form.

And I tried before with node 1 with the same result.

Ok, I found how to do it!!

Hurrah!!! Something in Chinese, looks like completed!

Delicate_Screenshot_2021-11-10_12-42-20

Thank you!

Thank you, my friend, I will record this question that
Because there is no income from doing open source, I need to spend a lot of energy to keep collecting various details of the problem, iteration plan, to discuss with my other open-source buddy.

So the project currently has some flaws, and there is room for continuous improvement.
Hope to get your understanding, if you can also support the work of delicate that will be grateful.

@makorne
Copy link

makorne commented Nov 10, 2021

Yes you do a BIG job.
And I think translating the messages into English is the easiest part.

Delicate_Screenshot_2021-11-10_17-04-49

Looks like it is an abnormal end.
Why did the easiest command ''ls -la" not end normally?

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 10, 2021

Yes you do a BIG job. And I think translating the messages into English is the easiest part.

Delicate_Screenshot_2021-11-10_17-04-49

Looks like it is an abnormal end. Why did the easiest command ''ls -la" not end normally?

No problem, I set up a ls -al on the public network web.delicate-rs.com and it works fine (
http://web.delicate-rs.com/taskList/5
), no problem at all.

image
image

Is there something wrong with your runtime environment, it has to do with your permissions or runtime context.

@makorne
Copy link

makorne commented Nov 11, 2021

I have no idea, what`s wrong for your executor on a perfectly working system with the same user in the same folder.

Delicate_Screenshot_2021-11-11_07-44-55

Delicate_Screenshot_2021-11-11_07-49-43

May be we use different versions of delicate?
I built the latest 1.3.2

May be I need to look at some delicate logs?

@BinChengZhao
Copy link
Owner

I have no idea, what`s wrong for your executor on a perfectly working system with the same user in the same folder.

Delicate_Screenshot_2021-11-11_07-44-55

Delicate_Screenshot_2021-11-11_07-49-43

May be we use different versions of delicate?
I built the latest 1.3.2

May be I need to look at some delicate logs?

There may be a problem with the environment variable of your local machine, please run the command to use the full path from /bin/... /ls

@makorne
Copy link

makorne commented Nov 11, 2021

Let`s try.

Delicate_Screenshot_2021-11-11_17-05-28

I tried updating task 3 to /bin/ls -la, and execute -> Success -> Nothing new in log.
Tried cloning 3 and executing this 4, Success -> Nothing in log.
Tried creating new 5 and executing, Success -> Nothing in log.

I saw some errors in executor:

Delicate_Screenshot_2021-11-11_17-08-25

Any ideas?
 

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 11, 2021

Let`s try.

Delicate_Screenshot_2021-11-11_17-05-28

I tried updating task 3 to /bin/ls -la, and execute -> Success -> Nothing new in log. Tried cloning 3 and executing this 4, Success -> Nothing in log. Tried creating new 5 and executing, Success -> Nothing in log.

I saw some errors in executor:

Delicate_Screenshot_2021-11-11_17-08-25

Any ideas?
 

Because you set Once mode (can only be executed once), the executor has already been executed before (and failed because the system's bash could not find the command.)

Please pause the task and update to RepeatCountDown mode, then activate the task again and it will be fine.

Friend, follow up you can open new issues or discussions so that it is easy for subsequent users to retrieve by title,
Thank you!

@makorne
Copy link

makorne commented Nov 11, 2021

Ok, let`s try pause/set Repeat/unpause/executing and the same for CountDown.

    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `/home/f/Prg/rs_test/tg/delicate/target/debug/delicate-executor`
Nov 11 17:33:23.996  INFO main poem::server: listening addr=socket://0.0.0.0:9080
Nov 11 17:33:23.996  INFO main poem::server: server started
Nov 11 18:55:29.157  INFO executor-14 update_task{task_package=3}: delicate_executor: pre_update_task: task-id:3 command:/bin/ls -la; frequency:{"mode":2,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:55:37.206  INFO executor-15 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631737 
Nov 11 18:55:37.207 ERROR event_handle_tokio delay_timer::timer::event_handle: Fn : `advance_task`, No task-mark found (task-id: 3 )    
Nov 11 18:56:17.694  INFO        executor-14 update_task{task_package=3}: delicate_executor: pre_update_task: task-id:3 command:/bin/ls -la; frequency:{"mode":3,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:57:06.620  INFO        executor-14 remove_task{task_id=3}: delicate_executor: pre_remove_task: task-unit:task-id:3 time:1636631826 
Nov 11 18:57:06.620 ERROR event_handle_tokio delay_timer::timer::event_handle:  Fn : `remove_task`,  No task-mark found (task-id: 3 )    
Nov 11 18:57:24.750  INFO        executor-15 create_task{task_package=3}: delicate_executor: pre_create_task: task-id:3 command:/bin/ls -la; frequency:{"mode":2,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:57:27.854  INFO        executor-15 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631847 
Nov 11 18:57:27.854 ERROR event_handle_tokio delay_timer::timer::event_handle: Fn : `advance_task`, No task found (task-id: 3 )    
Nov 11 18:58:03.561  INFO        executor-14 remove_task{task_id=3}: delicate_executor: pre_remove_task: task-unit:task-id:3 time:1636631883 
Nov 11 18:58:23.462  INFO        executor-13 create_task{task_package=3}: delicate_executor: pre_create_task: task-id:3 command:/bin/ls -la; frequency:{"mode":3,"extend":{"count":1000000},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:58:26.301  INFO        executor-13 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631906 

Again - nothing new in View Log:

Delicate_Screenshot_2021-11-11_19-03-42

Also newly created 5 should have been executed at least once, but it hasn`t been.

Ok, for any new issues I will create a new thread.

@BinChengZhao
Copy link
Owner

m::server: listening addr=socket://0.0.0.0:9080
Nov 11 17:33:23.996 INFO main poem::server: server started
Nov 11 18:55:29.157 INFO executor-14 update_task{task_package=3}: delicate_executor: pre_update_task: task-id:3 command:/bin/ls -la; frequency:{"mode":2,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:55:37.206 INFO executor-15 advance_task{task_id=3}: delicat

Ok, let`s try pause/set Repeat/unpause/executing and the same for CountDown.

    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `/home/f/Prg/rs_test/tg/delicate/target/debug/delicate-executor`
Nov 11 17:33:23.996  INFO main poem::server: listening addr=socket://0.0.0.0:9080
Nov 11 17:33:23.996  INFO main poem::server: server started
Nov 11 18:55:29.157  INFO executor-14 update_task{task_package=3}: delicate_executor: pre_update_task: task-id:3 command:/bin/ls -la; frequency:{"mode":2,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:55:37.206  INFO executor-15 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631737 
Nov 11 18:55:37.207 ERROR event_handle_tokio delay_timer::timer::event_handle: Fn : `advance_task`, No task-mark found (task-id: 3 )    
Nov 11 18:56:17.694  INFO        executor-14 update_task{task_package=3}: delicate_executor: pre_update_task: task-id:3 command:/bin/ls -la; frequency:{"mode":3,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:57:06.620  INFO        executor-14 remove_task{task_id=3}: delicate_executor: pre_remove_task: task-unit:task-id:3 time:1636631826 
Nov 11 18:57:06.620 ERROR event_handle_tokio delay_timer::timer::event_handle:  Fn : `remove_task`,  No task-mark found (task-id: 3 )    
Nov 11 18:57:24.750  INFO        executor-15 create_task{task_package=3}: delicate_executor: pre_create_task: task-id:3 command:/bin/ls -la; frequency:{"mode":2,"extend":{"count":1},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:57:27.854  INFO        executor-15 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631847 
Nov 11 18:57:27.854 ERROR event_handle_tokio delay_timer::timer::event_handle: Fn : `advance_task`, No task found (task-id: 3 )    
Nov 11 18:58:03.561  INFO        executor-14 remove_task{task_id=3}: delicate_executor: pre_remove_task: task-unit:task-id:3 time:1636631883 
Nov 11 18:58:23.462  INFO        executor-13 create_task{task_package=3}: delicate_executor: pre_create_task: task-id:3 command:/bin/ls -la; frequency:{"mode":3,"extend":{"count":1000000},"time_zone":1} cron_expression:* * * * * * * timeout:300 maximum_parallel_runnable_num:2
Nov 11 18:58:26.301  INFO        executor-13 advance_task{task_id=3}: delicate_executor: pre_advance_task: task-unit:task-id:3 time:1636631906 

Again - nothing new in View Log:

Delicate_Screenshot_2021-11-11_19-03-42

Also newly created 5 should have been executed at least once, but it hasn`t been.

Ok, for any new issues I will create a new thread.

My friend, I read your log.

You forgot to activate the executor, bind schduler & executor.

https://delicate-rs.github.io/quick_start.html

First, we go to execution-resources-executor-node to maintain delicate-executor into our system as a machine resource and perform the activation operation.

Because your executor is restarted and you need to perform the bindings.

@makorne
Copy link

makorne commented Nov 11, 2021

I don`t un-activate executor, so I do not think it needs activating again.

Ok, lets go for activating..

Delicate_Screenshot_2021-11-11_20-05-36

Strange status.
Pressing Activate changed nothing, just some Chinese flash message.
Status did not change.

But Execute now is doing some work!

Delicate_Screenshot_2021-11-11_20-13-51

But still not successful.
/bin/ls does not help.

@BinChengZhao
Copy link
Owner

BinChengZhao commented Nov 11, 2021

I don`t un-activate executor, so I do not think it needs activating again.

Ok, lets go for activating..

Delicate_Screenshot_2021-11-11_20-05-36

Strange status. Pressing Activate changed nothing, just some Chinese flash message. Status did not change.

But Execute now is doing some work!

Delicate_Screenshot_2021-11-11_20-13-51

But still not successful. /bin/ls does not help.

Because the executor forced restart causes scheduler & executor to lose communication, you have a yellow triangle there.

A green Chinese prompt appears, which means the activation was successful.

Hi @Walker-os , if you have time, please remember to add a post-update auto-refresh to the item in our issues_zh.md.

My friend @makorne , please don't put ; in the command, because Rust will pass -la; as an argument to the OS. /bin/ls -la will do the trick.

Normally you can see this error if you check the log details :ls: invalid option -- ';' Try 'ls --help' for more information.

@makorne
Copy link

makorne commented Nov 11, 2021

The ";" is filling the field at the start and so I thought it was mandatory :)

Thank you for all Great Friend!!!!

@BinChengZhao
Copy link
Owner

The ";" is filling the field at the start and so I thought it was mandatory :)

Thank you for all Great Friend!!!!

You're welcome, open-source made us meet!

@Walker-os
Copy link
Contributor

Walker-os commented Nov 12, 2021 via email

@BinChengZhao
Copy link
Owner

The ";" is filling the field at the start and so I thought it was mandatory :)
Thank you for all Great Friend!!!!

You're welcome, open-source made us meet!

No need to rush my friend @Walker-os, thanks for your support along the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants