1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Problem when loading plugins while server is running

Discussion in 'Development' started by instantlyta, Jan 26, 2018.

  1. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    No errors at start. But when the server is running, I couldn't load any more plugins.
    I ported a function from PharPluginLoader:

    PHP:
    public function getPluginDescription(string $file){
            
    $phar = new \Phar($file);
            if(isset(
    $phar["plugin.yml"])){
                
    $pluginYml $phar["plugin.yml"];
                if(
    $pluginYml instanceof \PharFileInfo){
                    return new 
    PluginDescription($pluginYml->getContent());
                }
            }

            return 
    null;
        }
    Here are the errors, sometimes the first, sometimes the second. I trimmed the string because it was long, and some unnecessary text. Notice the string that it inputs has some strange character at the beginning:

    Code:
    [19:55:04] [Server thread/CRITICAL]: ErrorException: "yaml_parse(): reading error encountered during parsing: invalid leading UTF-8 octet (line 1, column 1)" (EXCEPTION) in "src/pocketmine/plugin/PluginDescription" at line 60
    [19:55:04] [Server thread/DEBUG]: #0 (): pocketmine\error_handler(integer 2, string yaml_parse(): reading error encountered during parsing: invalid leading UTF-8 octet (line 1, column 1), string D:\Files\MCPE\PocketMine-MP\src\pocketmine\plugin\PluginDescription.php, integer 60, array Array())
    [19:55:04] [Server thread/DEBUG]: #1 src/pocketmine/plugin/PluginDescription(60): yaml_parse(string ...._.,Z......R.........main: aliuly\manyworlds\Main..api: 3.0.)
    [19:55:04] [Server thread/DEBUG]: #2 (562): pocketmine\plugin\PluginDescription->__construct(string ...._.,Z......R.........main: aliuly\manyworlds\Main..api: )
    [19:55:04] [Server thread/DEBUG]: #3 (332): ->getPluginDescription(string plugins\ManyWorlds.phar)
    
    Code:
    [20:15:25] [Server thread/CRITICAL]: ErrorException: "yaml_parse(): reading error encountered during parsing: control characters are not allowed (line 1, column 1)" (EXCEPTION) in "src/pocketmine/plugin/PluginDescription" at line 60
    [20:15:25] [Server thread/DEBUG]: #0 (): pocketmine\error_handler(integer 2, string yaml_parse(): reading error encountered during parsing: control characters are not allowed (line 1, column 1), string D:\Files\MCPE\PocketMine-MP\src\pocketmine\plugin\PluginDescription.php, integer 60, array Array())
    [20:15:25] [Server thread/DEBUG]: #1 src/pocketmine/plugin/PluginDescription(60): yaml_parse(string .?..,.,Z.?...d.p........name: MSpawns..main: MSpawns\Main..version: 1.6..api: [3.)
    [20:15:25] [Server thread/DEBUG]: #2 (561): pocketmine\plugin\PluginDescription->__construct(string .?..,.,Z.?...d.p........name: MSpawns..main: MSpawns\Main..version: 1.6..api: [3.0.0-ALPHA10]..load: STARTUP..author: EvolSoft..)
    Again, no errors when the server starts. The plugins loaded successfully.
     
  2. Epicrafter60

    Epicrafter60 Silverfish

    Messages:
    17
    Show us your plugin.yml it has a mistake
     
  3. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    Do you mean that you get an error when you add a new plugin and then try to load it by reloading the server? Try actually restarting the server instead.
     
  4. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    No, with the Server::getInstance()->getPluginManager()->loadPlugin();


    Fine:
    upload_2018-1-26_22-9-25.png

    upload_2018-1-26_22-10-10.png
     
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Did you use tabs in your plugin.yml file? YAML doesn't support tabs, only spaces.
     
    instantlyta likes this.
  6. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    Good information to know! Will check, thanks.
     
  7. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    Converted plugin.yml with the Tabs to Space in PhpStorm. No changes caught with git, I think it's not the problem because the strange string occurs at the beginning, which is nothing suspicious there. Any idea?
     
  8. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
  9. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.