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

Server crashing very often

Discussion in 'Help' started by Kabluinc, Dec 31, 2016.

  1. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Hi,
    My server keeps crashing every few hours with this crash log. This has been happening for a very long time and idk how to fix it.

    Crash dump:
    Code:
    PocketMine-MP Crash Dump Fri Dec 30 17:19:46 GMT 2016
    
    Error: Object of class pocketmine\level\Level could not be converted to string
    File: /src/pocketmine/Server
    Line: 1080
    Type: E_RECOVERABLE_ERROR
    
    Code:
    [1071] /**
    [1072] * @param string $name
    [1073] *
    [1074] * @return bool
    [1075] */
    [1076] public function isLevelGenerated($name){
    [1077] if(trim($name) === ""){
    [1078] return false;
    [1079] }
    [1080] $path = $this->getDataPath() . "worlds/" . $name . "/";
    [1081] if(!($this->getLevelByName($name) instanceof Level)){
    [1082]
    [1083] if(LevelProviderManager::getProvider($path) === null){
    [1084] return false;
    [1085] }
    [1086] }
    [1087]
    [1088] return true;
    [1089] }
    [1090]
    
    Backtrace:
    #0 (): pocketmine\Server->crashDump(boolean)
    
    PocketMine-MP version: 1.6.2dev #0 [Protocol 100; API 3.0.0-ALPHA1]
    Git commit: 0000000000000000000000000000000000000000
    uname -a: Windows NT NS306121 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
    PHP Version: 7.0.10
    Zend version: 3.0.0
    OS : WINNT, win
    
    
    Please help.
     
  2. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    Oops 1.6.2. It looks like somewhere in your server, or one of your plugins, tried to pass Level object through. Have you try removing all the Plugins for a moment?
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    the plugin tried to pass $level to the $name without getting level's name
     
    applqpak and dktapps like this.
  4. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    I have no idea what this means. Probably will never be able to fix it :/

    What sort of code using level stuff would cause this issue. I can then look thru plugin codes to see the culprit
     
  5. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    shows your plugins list?(/plugins)
    i recon i can try to help and even fix that as if it is a quite simple careless mistake of not passing the name
     
    applqpak likes this.
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    clearlag, economy land just blind guesses
    no clear idea since anything could just check for if X level is loaded
     
  7. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Iv had clearlag and economy land for about a year and never did the server crash for this reason till about 1-2 months ago
     
  8. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Try getting a backtrace using debug lvl2 or using php with debug..
     
    applqpak likes this.
  9. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    ^^ yeah you should just get the backtrace,
    i somehow forgotten that exist
     
  10. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    How can you forget it if a broken one is right at the first post? :p And that reminds me that no-one ever has found out why tf they sometimes break on windows. I guess #BlameMicrosoftSoHard
     
    applqpak likes this.
  11. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    what about the console backtrace?
    they often said
    XX/YY/Main on line X called Y......
    and it works on windows; for me at least
     
  12. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    How do I get a backtrace? I use a host where I only have access to the files and the php binary is not editable
     
  13. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Debug level 2 in pocketmine.yml
    console back trace only appears with debug level 2 :p
     
    applqpak likes this.
  14. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Thanks i will enable that and see what it shows. meanwhile, after looking thru the plugins, the ColorMatch plugin is the only plugin where isLevelGenerated is used the most. its also a fairly recently installed plugin.

    Places iv found this:
    PHP:
    if(!$this->getServer()->isLevelGenerated($this->cfg->getNested('lobby.world'))){
                
    $this->getServer()->generateLevel($this->cfg->getNested('lobby.world'));
    PHP:
    if(!$this->plugin->getServer()->isLevelGenerated($this->data['arena']['arena_world'])){
    PHP:
    if(!$this->plugin->getServer()->isLevelGenerated($this->data['arena']['leave_position_world'])){
     
  15. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    The ColorMatch plugin was the culprit. Any idea how I can fix this plugin to stop it crashing cos of this "isLevelGenerated" thing?

    Any help would be much appreciated
     
  16. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    patch it with level->get name
     
  17. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    So how would I do that? like: if(!$this->plugin->getServer()->isLevelGenerated($this->getServer->getLevel("worldname")){ ?
     
  18. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    no that's why it is emitting error
    do $level->getName
    not get level with name it should fix it
     
  19. Kabluinc

    Kabluinc Baby Zombie

    Messages:
    129
    Sorry I'm fairly new to all this so I don't really get how I would change the original code to what your saying.

    would this work?
    $level = $this->getServer()->getLevelByName($this->data['arena']['arena_world']);
    if(!$this->getServer()->isLevelGenerated($level);

    If I'm wrong please tell me what would be the exact code I would replace the original with.

    Sorry for the inconvinence.
     
    Last edited: Jan 5, 2017
  20. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    no problem
    hm can you upload the code full code of the .php that is causing issue?

    you could try
    $level = $this->data['arena']['arena_world'];
     
  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.