=== Test case: rest_client_SUITE:room_message_sending_errors/1 (click for source code)

=== Config value:

    [{watchdog,<0.87876.0>},
     {muc_light_host,<<"muclight.localhost">>},
     {mam_backend,rdbms},
     {preset,"pgsql_mnesia"},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_client_SUITE_data"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@327be9dfa6e9.2024-03-12_09.45.11/big_tests.tests.rest_client_SUITE.logs/run.2024-03-12_10.01.09/rest_client_suite.room_message_sending_errors.234882.html"},
     {tc_group_properties,[{name,muc},parallel]},
     {tc_group_path,[]},
     {data_dir,"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/rest_client_SUITE_data/"},
     {priv_dir,"/home/circleci/project/big_tests/ct_report/ct_run.test@327be9dfa6e9.2024-03-12_09.45.11/big_tests.tests.rest_client_SUITE.logs/run.2024-03-12_10.01.09/log_private/"},
     {{saved_modules,mongooseim@localhost,<<"localhost">>},
      #{mod_vcard =>
            #{matches => 30,
              host => {prefix,<<"vjud.">>},
              search => true,iqdisc => parallel,backend => rdbms},
        mod_roster =>
            #{iqdisc => one_queue,backend => rdbms,versioning => false,
              store_current_id => false},
        mod_register =>
            #{access => register,iqdisc => one_queue,
              registration_watchers => [],password_strength => 0,
              ip_access => [{allow,"127.0.0.0/8"},{deny,"0.0.0.0/0"}]},
        mod_sic => #{iqdisc => one_queue},
        mod_amp => #{},mod_presence => #{},
        mod_disco =>
            #{iqdisc => one_queue,users_can_see_hidden_services => false,
              server_info => [],extra_domains => []},
        mod_stream_management =>
            #{buffer => true,ack => true,backend => mnesia,
              stale_h =>
                  #{enabled => false,repeat_after => 1800,geriatric => 3600},
              buffer_max => 100,ack_freq => 1,resume_timeout => 600},
        mod_adhoc => #{iqdisc => one_queue,report_commands_node => false},
        mod_cache_users =>
            #{strategy => fifo,number_of_segments => 5,time_to_live => 2},
        mod_bosh =>
            #{backend => mnesia,inactivity => 30,max_pause => 120,
              max_wait => infinity,server_acks => false},
        mod_carboncopy => #{iqdisc => no_queue}}}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@327be9dfa6e9.2024-03-12_09.45.11"

=== Started at 2024-03-12 10:01:09


*** CT 2024-03-12 10:01:09.912 *** View log from node mongooseim@localhost when started🔗 mongooseim@localhost_4889.html

*** User 2024-03-12 10:01:10.018 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2024-03-12 10:01:10.018 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='373e508ac7288148' from='localhost' version='1.0' xml:lang='en'>

*** User 2024-03-12 10:01:10.018 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<stream:features>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2024-03-12 10:01:10.018 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsaWNFX3Jvb21fbWVzc2FnZV9zZW5kaW5nX2Vycm9yc18zMzE1AG1hdHlncnlzYQ==</auth>



*** User 2024-03-12 10:01:10.062 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2024-03-12 10:01:10.062 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2024-03-12 10:01:10.063 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='f3fb573c43c373d9' from='localhost' version='1.0' xml:lang='en' to='alice_room_message_sending_errors_3315@localhost'>

*** User 2024-03-12 10:01:10.063 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<stream:features>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2024-03-12 10:01:10.064 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 out
<iq type='set' id='00a4538296c8d84303be1b12a57c43f1'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2024-03-12 10:01:10.064 ***🔗
alicE_room_message_sending_errors_3315@localhost/res1 in
<iq id='00a4538296c8d84303be1b12a57c43f1' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>alice_room_message_sending_errors_3315@localhost/res1</jid>
	</bind>
</iq>



*** User 2024-03-12 10:01:10.064 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 out
<iq type='set' id='6b79c1dc2185c9f7ecb277c46dce9a49'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2024-03-12 10:01:10.065 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 in
<iq from='localhost' to='alice_room_message_sending_errors_3315@localhost/res1' id='6b79c1dc2185c9f7ecb277c46dce9a49' type='result'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2024-03-12 10:01:10.065 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 out
<presence/>



*** User 2024-03-12 10:01:10.069 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 in
<presence from='alice_room_message_sending_errors_3315@localhost/res1' to='alice_room_message_sending_errors_3315@localhost/res1'/>



*** User 2024-03-12 10:01:10.070 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2024-03-12 10:01:10.072 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3113b25be17f3950' from='localhost' version='1.0' xml:lang='en'>

*** User 2024-03-12 10:01:10.072 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<stream:features>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2024-03-12 10:01:10.072 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYl9yb29tX21lc3NhZ2Vfc2VuZGluZ19lcnJvcnNfMzMxNQBtYWtyb2xpa2E=</auth>



*** User 2024-03-12 10:01:10.077 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2024-03-12 10:01:10.077 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2024-03-12 10:01:10.077 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='a60e1579f5fbbe3b' from='localhost' version='1.0' xml:lang='en' to='bob_room_message_sending_errors_3315@localhost'>

*** User 2024-03-12 10:01:10.077 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<stream:features>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2024-03-12 10:01:10.077 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 out
<iq type='set' id='ee20674200be9df336bbd2e2068aa199'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2024-03-12 10:01:10.078 ***🔗
bOb_room_message_sending_errors_3315@localhost/res1 in
<iq id='ee20674200be9df336bbd2e2068aa199' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bob_room_message_sending_errors_3315@localhost/res1</jid>
	</bind>
</iq>



*** User 2024-03-12 10:01:10.078 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 out
<iq type='set' id='848ba721adf7a61db3c5ba76f00b1a1b'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2024-03-12 10:01:10.078 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 in
<iq from='localhost' to='bob_room_message_sending_errors_3315@localhost/res1' id='848ba721adf7a61db3c5ba76f00b1a1b' type='result'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2024-03-12 10:01:10.078 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 out
<presence/>



*** User 2024-03-12 10:01:10.115 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 in
<presence from='bob_room_message_sending_errors_3315@localhost/res1' to='bob_room_message_sending_errors_3315@localhost/res1'/>



*** User 2024-03-12 10:01:10.181 ***🔗
REST request:
Code: 201
Req: {<0.88425.0>,<<"/api/rooms">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"d3a45c85582cec1e">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"subject\":\"This room subject\",\"name\":\"new_room_name\"}">>}
Result: {{<<"201">>,<<"Created">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"27">>}],
         <<"{\"id\":\"1710-237670-164472\"}">>,156,19270}
Params: #{path => <<"/api/rooms">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body =>
              <<"{\"subject\":\"This room subject\",\"name\":\"new_room_name\"}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.196 ***🔗
REST request fails:
Code: 400
Req: {<0.88521.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"d5311d7875cca7dd">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"body\":{\"body\":\"Too nested\"}}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"22">>}],
         <<"\"Invalid message body\"">>,155,8539}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body => <<"{\"body\":{\"body\":\"Too nested\"}}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.219 ***🔗
REST request fails:
Code: 400
Req: {<0.88545.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e02fe6b5250f6e4d">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"no_body\":\"This should be in body\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"27">>}],
         <<"\"No valid message elements\"">>,160,17999}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body => <<"{\"no_body\":\"This should be in body\"}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.239 ***🔗
REST request fails:
Code: 400
Req: {<0.88553.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"d7c9a189b040c703">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"markable\":true}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"27">>}],
         <<"\"No valid message elements\"">>,160,15488}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body => <<"{\"markable\":true}">>,return_headers => true}


*** User 2024-03-12 10:01:10.267 ***🔗
REST request fails:
Code: 400
Req: {<0.88572.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"6ff1b562771f6900">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"chat_marker\":{\"type\":\"bad\",\"id\":\"some_id\"}}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"21">>}],
         <<"\"Invalid chat marker\"">>,154,2244}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body =>
              <<"{\"chat_marker\":{\"type\":\"bad\",\"id\":\"some_id\"}}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.273 ***🔗
REST request fails:
Code: 400
Req: {<0.88595.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"8a0ba70def705f7f">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"This is not JSON object">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"22">>}],
         <<"\"Invalid request body\"">>,155,1509}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,
          body => <<"This is not JSON object">>,return_headers => true}


*** User 2024-03-12 10:01:10.307 ***🔗
REST request fails:
Code: 403
Req: {<0.88617.0>,<<"/api/rooms/1710-237670-164472/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"a719613361e60493">>},
       {<<"authorization">>,
        <<"Basic Ym9iX3Jvb21fbWVzc2FnZV9zZW5kaW5nX2Vycm9yc18zMzE1QGxvY2FsaG9zdDptYWtyb2xpa2E=">>}],
      <<"{\"body\":\"Hi\"}">>}
Result: {{<<"403">>,<<"Forbidden">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"38">>}],
         <<"\"Given user does not occupy this room\"">>,169,29797}
Params: #{path => <<"/api/rooms/1710-237670-164472/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"bob_room_message_sending_errors_3315@localhost">>,
               <<"makrolika">>},
          role => client,method => <<"POST">>,body => <<"{\"body\":\"Hi\"}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.320 ***🔗
REST request fails:
Code: 404
Req: {<0.88680.0>,<<"/api/rooms/badroom/messages">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"31f495826b0e0537">>},
       {<<"authorization">>,
        <<"Basic YWxpY2Vfcm9vbV9tZXNzYWdlX3NlbmRpbmdfZXJyb3JzXzMzMTVAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"body\":\"Hi\"}">>}
Result: {{<<"404">>,<<"Not Found">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 12 Mar 2024 10:01:10 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"16">>}],
         <<"\"Room not found\"">>,147,6978}
Params: #{path => <<"/api/rooms/badroom/messages">>,
          server => #{node => mongooseim@localhost},
          creds =>
              {<<"alice_room_message_sending_errors_3315@localhost">>,
               <<"matygrysa">>},
          role => client,method => <<"POST">>,body => <<"{\"body\":\"Hi\"}">>,
          return_headers => true}


*** User 2024-03-12 10:01:10.320 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 out
</stream:stream>

*** User 2024-03-12 10:01:10.321 ***🔗
bob_room_message_sending_errors_3315@localhost/res1 in
</stream:stream>

*** User 2024-03-12 10:01:10.321 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 out
</stream:stream>

*** User 2024-03-12 10:01:10.321 ***🔗
alice_room_message_sending_errors_3315@localhost/res1 in
</stream:stream>
*** CT 2024-03-12 10:01:10.329 *** View log from node mongooseim@localhost when finished🔗 mongooseim@localhost_4890.html



=== Ended at 2024-03-12 10:01:10
=== successfully completed test case
=== === Returned value: ok