GithubHelp home page GithubHelp logo

I am getting the error while setting on Runcloud Based Setup on Normal setup its working like a charm but on Runcloud I am have this issue. about apm-agent-php HOT 7 OPEN

Arya-Aniket avatar Arya-Aniket commented on June 10, 2024
I am getting the error while setting on Runcloud Based Setup on Normal setup its working like a charm but on Runcloud I am have this issue.

from apm-agent-php.

Comments (7)

intuibase avatar intuibase commented on June 10, 2024

Hey @Arya-Aniket

Did you tried to add /opt/elastic/apm-agent-php to realpath_turbo.open_basedir or open_basedir?

from apm-agent-php.

Arya-Aniket avatar Arya-Aniket commented on June 10, 2024

@intuibase

I have tried that now I am getting 0 out of know where in admin-ajax.php on wordpress after json

{
"success": true,
"data": {
"count": 1,
"items": "<input type="hidden" name="_wp_http_referer" value="/wp-admin/plugin-install.php?s=woom&tab=search&type=term&pagenow=plugin-install" />\t\t\t<div class="tablenav top">\n\t\t\t\t<div class="alignleft actions">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t

<span class="displaying-num">1 item</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>\n<span class="paging-input"><label for="current-page-selector" class="screen-reader-text">Current Page</label><input class='current-page' id='current-page-selector' type='text'\n\t\t\t\t\tname='paged' value='1' size='1' aria-describedby='table-paging' /> of 1</span></span></span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span></span></div>\t\t\t\t<br class="clear" />\n\t\t\t</div>\n\t\t<div class="wp-list-table widefat plugin-install">\n\t\t\t<div id="the-list">\n\t\t\t\t<div class="plugin-card plugin-card-wooms">\n\t\t\t<div class="notice notice-error notice-alt inline">

This plugin does not work with your version of PHP. <a href="https://wordpress.org/support/update-php/">Learn more about updating PHP</a>.</p></div>\t\t\t<div class="plugin-card-top">\n\t\t\t\t<div class="name column-name">\n\t\t\t\t\t

\n\t\t\t\t\t\t<a href="https://accessible-ajax-nls4.stagesite.top/wp-admin/plugin-install.php?tab=plugin-information&plugin=wooms&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal">\n\t\t\t\t\t\tWooMS\t\t\t\t\t\t<img src="https://ps.w.org/wooms/assets/icon-256x256.jpg?rev=2826440" class="plugin-icon" alt="" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h3>\n\t\t\t\t</div>\n\t\t\t\t<div class="action-links">\n\t\t\t\t\t<ul class="plugin-action-buttons">
  • <button type="button" class="button button-disabled" disabled="disabled">Cannot Install</button></li>
  • <a href="https://accessible-ajax-nls4.stagesite.top/wp-admin/plugin-install.php?tab=plugin-information&plugin=wooms&TB_iframe=true&width=600&height=550" class="thickbox open-plugin-details-modal" aria-label="More information about WooMS 9.10" data-title="WooMS 9.10">More Details</a></li></ul>\t\t\t\t</div>\n\t\t\t\t<div class="desc column-description">\n\t\t\t\t\t

    MoySklad (moysklad.ru) and WooCommerce - sync, integration, connection</p>\n\t\t\t\t\t<p class="authors"> By <a href="https://wpcraft.ru/">WPCraft</a></cite></p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="plugin-card-bottom">\n\t\t\t\t<div class="vers column-rating">\n\t\t\t\t\t<div class="star-rating"><span class="screen-reader-text">4.0 rating based on 22 ratings</span><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-full" aria-hidden="true"></div><div class="star star-empty" aria-hidden="true"></div></div>\t\t\t\t\t<span class="num-ratings" aria-hidden="true">(22)</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="column-updated">\n\t\t\t\t\tLast Updated:</strong>\n\t\t\t\t\t2 months ago\t\t\t\t</div>\n\t\t\t\t<div class="column-downloaded">\n\t\t\t\t\t700+ Active Installations\t\t\t\t</div>\n\t\t\t\t<div class="column-compatibility">\n\t\t\t\t\t<span class="compatibility-compatible">Compatible</strong> with your version of WordPress</span>\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t\t\t</div>\n</div>\n\t\t\t\t\t<div class="tablenav bottom">\n\t\t\t\t

    <span class="displaying-num">1 item</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>\n<span class="screen-reader-text">Current Page</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">1 of 1</span></span></span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>\n<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span></span></div>\t\t\t\t<br class="clear" />\n\t\t\t</div>\n\t\t\t"
    }
    }0

    this issue coming from this file:

    root@zwp-server:~# nano /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php ;
    root@zwp-server:~# cat /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php -n
         1  <?php
         2
         3  /*
         4   * Licensed to Elasticsearch B.V. under one or more contributor
         5   * license agreements. See the NOTICE file distributed with
         6   * this work for additional information regarding copyright
         7   * ownership. Elasticsearch B.V. licenses this file to you under
         8   * the Apache License, Version 2.0 (the "License"); you may
         9   * not use this file except in compliance with the License.
        10   * You may obtain a copy of the License at
        11   *
        12   *     http://www.apache.org/licenses/LICENSE-2.0
        13   *
        14   * Unless required by applicable law or agreed to in writing,
        15   * software distributed under the License is distributed on an
        16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
        17   * KIND, either express or implied.  See the License for the
        18   * specific language governing permissions and limitations
        19   * under the License.
        20   */
        21
        22  declare(strict_types=1);
        23
        24  namespace Elastic\Apm\Impl\Util;
        25
        26  /**
        27   * Code in this file is part of implementation internals and thus it is not covered by the backward compatibility.
        28   *
        29   * @internal
        30   */
        31  final class JsonUtil
        32  {
        33      use StaticClassTrait;
        34
        35      /**
        36       * @param mixed $data
        37       * @param bool  $prettyPrint
        38       *
        39       * @return string
        40       *
        41       * @throws JsonException
        42       */
        43      public static function encode($data, bool $prettyPrint = false): string
        44      {
        45          $options = JSON_INVALID_UTF8_SUBSTITUTE;
        46          $options |= $prettyPrint ? JSON_PRETTY_PRINT : 0;
        47          $encodedData = json_encode($data, $options);
        48          if ($encodedData === false) {
        49              throw new JsonException(
        50                  'json_encode() failed'
        51                  . '. json_last_error_msg(): ' . json_last_error_msg()
        52                  . '. dataType: ' . DbgUtil::getType($data)
        53              );
        54          }
        55          return $encodedData;
        56      }
        57  }
    
  • from apm-agent-php.

    Arya-Aniket avatar Arya-Aniket commented on June 10, 2024

    @intuibase
    resolve this by removing : 0

    public static function encode($data, bool $prettyPrint = false): string
            {
             $options = JSON_INVALID_UTF8_SUBSTITUTE;
              $options |= $prettyPrint ? JSON_PRETTY_PRINT : {}; // original code => $options |= $prettyPrint ? JSON_PRETTY_PRINT : 0;
           $encodedData = json_encode($data, $options);
             if ($encodedData === false) {
                throw new JsonException(
                 'json_encode() failed'
                  . '. json_last_error_msg(): ' . json_last_error_msg()
                    . '. dataType: ' . DbgUtil::getType($data)
             );
         }
            return $encodedData;
          }
    

    from apm-agent-php.

    Arya-Aniket avatar Arya-Aniket commented on June 10, 2024

    @intuibase @pierrehilbert
    /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php
    Can you please help me with this

    from apm-agent-php.

    pierrehilbert avatar pierrehilbert commented on June 10, 2024

    Unfortunately I'm not familiar with the APM Agent for PHP.
    @intuibase should be able to help you.

    from apm-agent-php.

    SergeyKleyman avatar SergeyKleyman commented on June 10, 2024

    Hi @Arya-Aniket Could you please try the latest agent version. We fixed issue #1120 which is related to JSON encoding done by the agent.

    from apm-agent-php.

    Arya-Aniket avatar Arya-Aniket commented on June 10, 2024

    @SergeyKleyman I tried, but getting error while using page editor.

    Receiving 0 at the end of every api response json.

    {
    "success": true,
    "data": {
    "count": 67,
    "items": ""
    }
    }0

    1. Error
      Notice: Undefined variable: 2097152 in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 47

    Notice: Undefined variable: 2097152 in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 47

    1. Error
      runcloud@Test-Elk-Server:~/webapps/app-conroy$ tail -f wp-content/debug.log
      #4 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/ExecutionSegment.php(578): Elastic\Apm\Impl\Tracer->sendSpanToApmServer()
      #5 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Span.php(488): Elastic\Apm\Impl\ExecutionSegment->onChildSpanEnded()
      #6 /opt/elastic/apm-agent-php/src/ElasticApm/Impl/AutoInstrument/Util/AutoInstrumentationUt in /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php on line 49
      [22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-admin/includes/misc.php on line 1431
      [22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-includes/functions.php on line 7049
      [22-Feb-2024 13:52:47 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /opt/elastic/apm-agent-php/src/ElasticApm/Impl/Util/JsonUtil.php:21) in /home/runcloud/webapps/app-conroy/wp-admin/admin-header.php on line 9
      [01-Apr-2024 12:14:43 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1435
      [01-Apr-2024 12:14:43 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1438
      [01-Apr-2024 12:14:48 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1435
      [01-Apr-2024 12:14:48 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/runcloud/webapps/app-conroy/wp-includes/rest-api/class-wp-rest-server.php:556) in /home/runcloud/webapps/app-conroy/wp-includes/pluggable.php on line 1438

    from apm-agent-php.

    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.