Comments (9)
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.
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.
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.
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.
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.
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.
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:
- http://*:8000 under /usr/local/Cellar/yaws/2.1.1/var/yaws/www
- http://localhost:8000 under /private/tmp
=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.
On MacOS Erlang and Yaws installed with brew
from yaws.
@vinoski Thx a lot. It works for me on Ubuntu 22.04.
from yaws.
Related Issues (20)
- Is there any plan to add QUIC support? HOT 1
- tlsv1.3-only server HOT 6
- tlsv1.3 cipher selection HOT 3
- Yaws assumes `error_logger` process always exists and it is a gen_event HOT 7
- Support reproducible builds HOT 5
- JSON-RPC payloads don't need urldecode step HOT 1
- Failed to compile 2.1.1 with Erl22, but 2.1.0 worked HOT 1
- Error on launch application Yaws HOT 4
- Crash Yaws after running HOT 2
- when reconfiguring, no check for changed appmods is done HOT 3
- yaws in NixOS 22.05 for aarch64 gives error during system build HOT 2
- Fail when make install and deterministic build is enabled HOT 3
- build breaks with OTP 27 HOT 2
- Error on building Yaws on Manjaro Linux on Erlang OTP-27 HOT 1
- failed to install qt5
- Can't start Yaws web server on Ubuntu 22 HOT 2
- yaws_config.erl:3563:20: file:pid2name/1 is deprecated and will be removed in OTP 27 HOT 2
- Check that Basic authentication user doesn't contain control characters HOT 1
- Add CI tests for OTP master and maint branches
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaws.