[CloudI] [examples] Error adding a compiled Erlang BEAM file path with an internal service implementation

Back to archive index
Michael Truog mjtru****@proto*****
Wed Dec 22 14:36:18 JST 2021


Hi Filipe,

If you use the recent commit (https://github.com/CloudI/CloudI/commit/03d4575a84416f9458207da9e95b694d1f1f769b) on the develop branch, you will be using the fix for this problem.

The problem prevents the web interface from getting its view of the services. If too many requests occurred (5 (MaxR) within 5 minutes (MaxT)) the cloudi_service_api_requests service would be stopped instead of restarted due to the error.

Best Regards,
Michael

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, December 21st, 2021 at 8:03 PM, Michael Truog <mjtru****@proto*****> wrote:

> Hi Filipe,
>
> Thank you for reporting this problem. You have found a bug in the cloudi_service_api_requests JSON output. The rest of the stacktrace in the log output should confirm that. By that I mean the output after:
> 2021-12-22T02:40:46.363937Z ERROR (cloudi_core_i_services_internal:867:handle_info/2:<0.1374.0>:cloudi at 9a82290a0570)
> request error badarg
> [{erlang,atom_to_binary,
> ...
>
> That means this request works:
> curl http://localhost:6464/cloudi/api/rpc/services.erl
>
> However, this request will fail, if you have added a service that uses a string value for module parameter:
> curl http://localhost:6464/cloudi/api/rpc/services.json
>
> I will add a fix for this.
>
> Thanks,
> Michael
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday, December 21st, 2021 at 7:28 PM, Filipe Moraes <dev_filip****@hotma*****> wrote:
>
>> Hi everybody,
>>
>> I'm trying https://github.com/CloudI/CloudI/tree/v2.0.4/examples/hello_world_erlang - section "To use a compiled Erlang BEAM file path with an internal service implementation".
>>
>> Following the documentation steps
>>
>>> $ cat << EOF > hello_world_erlang_beam.conf
>>> [[{prefix, "/examples/"},
>>> {module, "$PWD/ebin/hello_world_erlang.beam"}]]
>>> EOF
>>> $ curl -X POST -d @hello_world_erlang_beam.conf http://localhost:6464/cloudi/api/rpc/services_add.erl
>>
>> I get the UUID and service is up and running, but something stop working after an internal error occurs due calling atom_to_binary/2 with string parameter.
>>
>>> 2021-12-22T02:40:46.363937ZERROR (cloudi_core_i_services_internal:867:handle_info/2:<0.1374.0>:cloudi at 9a82290a0570)
>>> request error badarg
>>> [{erlang,atom_to_binary,
>>> ["/workspace/clones/CloudI/CloudI/examples/hello_world_erlang/ebin/hello_world_erlang.beam",
>>> utf8],
>>> [{error_info,#{module => erl_erts_errors}}]},
>>
>> Service remains up and responding to requests, but service summary stop working.
>>
>> While I was writing this email I tried this (and things seems ok now):
>>
>> Edit .conf:
>>
>>> [[{prefix, "/examples/"},
>>> {type, internal},
>>> {module, hello_world_erlang}]]
>>
>> Add code path and service conf:
>>
>>> curl -X POST -d '"'`pwd`/ebin'"' http://localhost:6464/cloudi/api/rpc/code_path_add.erl
>>> curl -X POST -d @hello_world_erlang.conf http://localhost:6464/cloudi/api/rpc/services_add.erl
>>
>> I'm not sure if this behavior is a bug... but it seems the doc contains wrong instructions.
>>
>> --
>> Filipe Moraes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/cloudi-questions/attachments/20211222/25adc690/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 19978 bytes
Desc: not available
URL: <https://lists.osdn.me/mailman/archives/cloudi-questions/attachments/20211222/25adc690/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 31431 bytes
Desc: not available
URL: <https://lists.osdn.me/mailman/archives/cloudi-questions/attachments/20211222/25adc690/attachment-0003.png>


More information about the cloudi-questions mailing list
Back to archive index