Giter Club home page Giter Club logo

Comments (9)

vinoski avatar vinoski commented on May 27, 2024 1

Looks like Ubuntu sets log_wrap_size to 0 in /etc/yaws/yaws.conf in an attempt to turn off log rotation, which should be valid, but this crashes the Erlang/OTP logger_std_h because it doesn't allow its max_no_bytes setting to be 0. For no rotation, it should be set to infinity, but this can't be achieved via yaws.conf because it only allows integers for this setting.

As a workaround, try setting log_wrap_size in /etc/yaws/yaws.conf on Ubuntu to an integer value like 1000000, which is the Yaws default, or some other integer value of your choosing.

from yaws.

vinoski avatar vinoski commented on May 27, 2024

What version of OTP are you using?

When this error occurs, does the /mnt/log/gcf/gcfp directory already exist? I tried removing report.log for my yaws instance and it was recreated after restarting yaws, so I suspect in your case the logging directory doesn't exist.

from yaws.

ignatenkobrain avatar ignatenkobrain commented on May 27, 2024

Hello @vinoski! We are using OTP 24.3.

The /mnt/log/gcf/gcfp directory does not exist and the application runs from non-root user so even if it would exist, it would get permission denied when trying to create files.

In production, it works fine as we have all directories set and such. However, in testing environment (where we don't care about these logs), previously it was simply not logging to the file while now it crashes our application on start.

from yaws.

vinoski avatar vinoski commented on May 27, 2024

This is almost certainly due to the switchover to the OTP 21 Logger about 5 years ago.

For your testing environment, can you configure your yaws logging directory to /tmp or similar?

from yaws.

alexandrkirilov avatar alexandrkirilov commented on May 27, 2024

Got tested using /tmp dir for the same error. Nothing changed for me yet.
`=INFO REPORT==== 16-Oct-2023::20:14:52.240134 ===
yaws debug:Running with id="default"
Running with debug checks turned on (slower server)
Logging to directory "/tmp"

=INFO REPORT==== 16-Oct-2023::20:14:52.243230 ===
Ctlfile : /root/.yaws/yaws/default/CTL

=ERROR REPORT==== 16-Oct-2023::20:14:52.432838 ===
** Generic server yaws_log terminating
** Last message in was {setup,
{gconf,"/usr/lib/yaws",false,102,"/tmp",
["/usr/local/lib/yaws-appmods/ebin",
"/usr/lib/yaws/examples/ebin"],
[],[],30000,nolimit,400,1000000,8000,nolimit,
[],10240,[],0,0,
["/usr/local/lib/yaws-appmods/include",
"/usr/lib/yaws/examples/include"],
"/usr/bin/php-cgi","Yaws 2.1.1","default",
false,[],8,undefined,
[inet],
yaws_session_server,undefined,120000,3600000,
disable},
[[{sconf,8443,7,[],undefined,undefined,
"/usr/share/yaws/www",[],
{0,0,0,0},
"localhost:8443",[],undefined,undefined,
{ssl,"/etc/yaws/yaws-key.pem",
"/etc/yaws/yaws-cert.pem",verify_none,
undefined,1,undefined,undefined,
undefined,undefined,undefined,false,true,
true,undefined,false,undefined,#{}},
[{"/usr/share/yaws/www",[]}],
10240,[],[],yaws_outmod,yaws_outmod,
yaws_outmod,yaws,yaws_log,[],undefined,
[yaws,php,cgi,fcgi],
[],
["index.yaws","index.html","index.php"],
[],
[{listen_opts,[{backlog,1024}]}],
[],undefined,undefined,
{cgi,"/usr/bin/php-cgi"},
undefined,undefined,undefined,undefined,[],
undefined}],
[{sconf,8080,7,[],undefined,undefined,
"/usr/share/yaws/www",[],
{0,0,0,0},
"localhost:8080",[],undefined,undefined,
undefined,
[{"/usr/share/yaws/www",[]}],
10240,[],[],yaws_outmod,yaws_outmod,
yaws_outmod,yaws,yaws_log,[],undefined,
[yaws,php,cgi,fcgi],
[],
["index.yaws","index.html","index.php"],
[],
[{listen_opts,[{backlog,1024}]}],
[],undefined,undefined,
{cgi,"/usr/bin/php-cgi"},
undefined,undefined,undefined,undefined,[],
undefined}]]}
** When Server state == {state,false,undefined,
["[","16","/","Oct","/","2023",":","20",":",
"14",":","52"," ",
[43,"00","00"],
"]"],
1000000,undefined,false}
** Reason for termination ==
** {{badmatch,
{error,
{handler_not_added,
{invalid_config,logger_std_h,#{max_no_bytes => 0}}}}},
[{yaws_log,handle_call,3,[{file,"yaws_log.erl"},{line,177}]},
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,1113}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,1142}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,241}]}]}
** Client yaws_server stacktrace
** [{gen,do_call,4,[{file,"gen.erl"},{line,240}]},
{gen_server,call,3,[{file,"gen_server.erl"},{line,397}]},
{yaws_server,init2,5,[{file,"yaws_server.erl"},{line,237}]},
{gen_server,init_it,2,[{file,"gen_server.erl"},{line,962}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,917}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,241}]}]`

from yaws.

alexandrkirilov avatar alexandrkirilov commented on May 27, 2024

Tried to run application under root permission and under the non-root. It's happening ONLY on Ubuntu. On MacOS and FreeBSD all is Ok.

from yaws.

alexandrkirilov avatar alexandrkirilov commented on May 27, 2024

Here the log from MacOS

`$ yaws
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] [dtrace]

=INFO REPORT==== 16-Oct-2023::23:20:15.171274 ===
Yaws: Using config file /usr/local/Cellar/yaws/2.1.1/etc/yaws/yaws.conf

Eshell V14.0.2 (press Ctrl+G to abort, type help(). for help)
=ERROR REPORT==== 16-Oct-2023::23:20:15.172339 ===
Config Warning: Directory /usr/local/Cellar/yaws/2.1.1/lib/yaws/examples/include for include_dir doesn't exist

=INFO REPORT==== 16-Oct-2023::23:20:15.258318 ===
Yaws: Using global subconfig file /Users/alexandr/Tools/Yaws/ExtendedConfig/host1.conf

=INFO REPORT==== 16-Oct-2023::23:20:15.258848 ===
Yaws: Using global subconfig file /Users/alexandr/Tools/Yaws/ExtendedConfig/host2.conf

=INFO REPORT==== 16-Oct-2023::23:20:15.285869 ===
Ctlfile : /Users/alexandr/.yaws/yaws/default/CTL

=INFO REPORT==== 16-Oct-2023::23:20:15.411639 ===
Yaws: Listening to 0.0.0.0:8888 for <1> virtual servers:

  • http://*:8888 under undefined

=INFO REPORT==== 16-Oct-2023::23:20:15.415233 ===
Yaws: Listening to 0.0.0.0:8000 for <2> virtual servers:

=INFO REPORT==== 16-Oct-2023::23:20:15.415478 ===
Yaws: Listening to 0.0.0.0:7777 for <1> virtual servers:

  • http://*:7777 under undefined

=INFO REPORT==== 16-Oct-2023::23:20:15.429473 ===
Yaws: Listening to 0.0.0.0:4443 for <1> virtual servers:

  • https://*:4443 under /private/tmp`

from yaws.

alexandrkirilov avatar alexandrkirilov commented on May 27, 2024

On MacOS Erlang and Yaws installed with brew

from yaws.

alexandrkirilov avatar alexandrkirilov commented on May 27, 2024

@vinoski Thx a lot. It works for me on Ubuntu 22.04.

from yaws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.