weaver icon indicating copy to clipboard operation
weaver copied to clipboard

deploy the application error

Open y26s4824k264 opened this issue 1 year ago • 7 comments

image

y26s4824k264 avatar Mar 06 '23 16:03 y26s4824k264

image

y26s4824k264 avatar Mar 06 '23 16:03 y26s4824k264

Hi I got the same error but on mac

filename "...2f6add44-e6ff-4bff-8d89-8ebe81a69af3.error.log" must have format "<app>.<deployment>.<weavelet>.<level>.log"

Any idea ??

alejandrojnm avatar Mar 06 '23 18:03 alejandrojnm

Thanks @y26s4824k264 and @alejandrojnm for filing this bug! Here's what I think is happening.

When you weaver multi deploy an application, the application's logs are written to files in /tmp/serviceweaver/logs/weaver-multi. This following code computes the names of the log files as a concatenation of four things (the app name, the deployment id, the weavelet id, and the log level):

https://github.com/ServiceWeaver/weaver/blob/262d632dfaa2654e6e94aa4a73a0ccd8302253b7/runtime/logging/files.go#L149-L151

Elsewhere in the code, we try to parse these four things out of the filename:

https://github.com/ServiceWeaver/weaver/blob/262d632dfaa2654e6e94aa4a73a0ccd8302253b7/runtime/logging/files.go#L167-L171

By default, if you don't provide an application name, Service Weaver takes the name of the binary as the application name. So, what I think is happening is that Service Weaver is taking the name of the binary (i.e. awesomeProject2.exe) as the application name, but because it has a period in it, it is messing up how we parse log filenames.

This is a bug, and we'll fix it. In the meantime, try explicitly adding an application name to your config file:

[serviceweaver]
name = "awesomeProject2"
binary = "./awesomeProject2.exe"

mwhittaker avatar Mar 06 '23 19:03 mwhittaker

@mwhittaker I put the name and I got the same error this is the toml file

[serviceweaver]
name = "api"
binary = "./api"

alejandrojnm avatar Mar 06 '23 19:03 alejandrojnm

Do you mind trying to delete all the log files in /tmp/serviceweaver/logs/weaver-multi and then trying again? The ill-formatted log file might still exist and could be messing things up.

mwhittaker avatar Mar 06 '23 19:03 mwhittaker

I don't have that in my tmp folder

alejandrojnm avatar Mar 06 '23 19:03 alejandrojnm

I don't have that in my tmp folder

Most likely if you are on a Mac it'll be under the /var/folders temporary directory

aranw avatar Mar 06 '23 19:03 aranw

On win11, Win+R and input %temp% to open the temp dir. delete all the log files is ok !

geange avatar Mar 20 '23 02:03 geange

On win11, Win+R and input %temp% to open the temp dir. delete all the log files is ok !

%temp%\serviceweaver\logs\weaver-multi it seems that weaver multi is not supported on win10

comyxy avatar Mar 22 '23 15:03 comyxy

I'm closing this issue because it seems resolved? Feel free to re-open if not.

mwhittaker avatar Apr 03 '23 20:04 mwhittaker

I think this should also be added to the official documentation(https://serviceweaver.dev/docs.html#multiprocess). Or, would it be difficult to apply branch handling only for windows?

Currently, it is difficult to solve without looking at this issue.

myyrakle avatar Apr 06 '23 18:04 myyrakle

https://github.com/ServiceWeaver/weaver/pull/232

What do you think of processing in this form? Are there side effects or other issues?

myyrakle avatar Apr 06 '23 18:04 myyrakle