Items disappear

Issue #26 new
DoctorVal created an issue

From time to time when item drop and player pick it up

somehow objectId already exist in items table and after char restart that item vanish

Comments (14)

  1. DoctorVal reporter

    i report it again cause all git reports are lost there is no way to reproduce it.

    More players more often for this to happen ;)

    it duplicate entries (item object Id) when it tries to save item-items in database

    so after player restart item is not saved and lost

    i dont have the exact log

    id factory sometimes generates already existed id.

  2. DoctorVal reporter

    I gave them the exact stack trace when this happen And i explained here what is the problem

    If you cant see a molecule without a microscope it does nt mean that is not there ;)

  3. ShinichiYao

    Every duplicate objectId is an exist item that had ever passed by mail system.

    #!
    
    [28 Jun 23:09:11] CREATE:Loot, item 268592823:Sealed Vorpal Boots(1), L2PcInstance:PlayerA[268501501], L2GrandBossInstance:Valakas(29028)[268437623]
    [28 Jun 23:10:48] SETOWNER:Party, item 268592823:Sealed Vorpal Boots(1), L2PcInstance:PlayerB[268502157], L2PcInstance:PlayerB[268502157]
    [29 Jun 15:20:03] SETOWNER:SendMail, item 268592823:Sealed Vorpal Boots(1), L2PcInstance:PlayerB[268502157], PlayerC[268529091]
    [29 Jun 16:00:09] SETOWNER:Mail, item 268592823:Sealed Vorpal Boots(1), L2PcInstance:PlayerC[268529091]
    [29 Jun 20:10:02] SETOWNER:Warehouse, item 268592823:Sealed Vorpal Boots(1), L2PcInstance:PlayerC[268529091], L2WarehouseInstance:Walderal(30844)[268473246]
    [29 Jun 21:32:02] CREATE:Multisell, item 268592823:Tiphon's Spear(1), L2PcInstance:PlayerD[268521961], L2ClassMasterInstance:Mr. Cat(31756)[268473298]
    
    #!
    
    Jun 29, 2017 9:32:02 PM com.l2jserver.gameserver.model.items.instance.L2ItemInstance insertIntoDb
    SEVERE: Could not insert item Tiphon's Spear(8683)[268592823] into DB: Reason: Duplicate entry '268592823' for key 'PRIMARY'
    com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '268592823' for key 'PRIMARY'
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
        at com.mysql.jdbc.Util.getInstance(Util.java:383)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2113)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2049)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2034)
        at com.zaxxer.hikari.proxy.PreparedStatementProxy.executeUpdate(PreparedStatementProxy.java:61)
        at com.zaxxer.hikari.proxy.HikariPreparedStatementProxy.executeUpdate(HikariPreparedStatementProxy.java)
        at com.l2jserver.gameserver.model.items.instance.L2ItemInstance.insertIntoDb(L2ItemInstance.java:1692)
        at com.l2jserver.gameserver.model.items.instance.L2ItemInstance.updateDatabase(L2ItemInstance.java:1466)
        at com.l2jserver.gameserver.model.items.instance.L2ItemInstance.updateDatabase(L2ItemInstance.java:1436)
        at com.l2jserver.gameserver.model.itemcontainer.ItemContainer.addItem(ItemContainer.java:328)
        at com.l2jserver.gameserver.model.itemcontainer.PcInventory.addItem(PcInventory.java:509)
        at com.l2jserver.gameserver.network.clientpackets.MultiSellChoose.runImpl(MultiSellChoose.java:410)
        at com.l2jserver.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:69)
        at com.l2jserver.gameserver.network.L2GameClient.run(L2GameClient.java:1134)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    
  4. DoctorVal reporter

    Did you find a way to reproduce item dissapear issue? If yes please post here step by step how you do it I tried the way from previous post and no diplicate issue

  5. ShinichiYao

    I cant reproduce this issue. It happens very tiny probability. I have about a hundred of players for over one year and use mail system everyday. It only happend 3 times. But I can confirm every time the duplicate id of exist item had ever passed by mail system and the duplicate id generate at the same day. I restart server everyday at 3:30AM by the way.

    another log here:

    #!
    
    [18 Jun 17:42:42] CREATE:Party, item 268580498:Sealed Vesper Gloves(1), L2PcInstance:PlayerA[268505058], L2MonsterInstance:Maluk Leader(22838)[268578834]
    [23 Jun 10:11:27] SETOWNER:SendMail, item 268580498:Sealed Vesper Gloves(1), L2PcInstance:PlayerA[268505058], PlayerB[268502904]
    [23 Jun 11:20:02] SETOWNER:Mail, item 268580498:Sealed Vesper Gloves(1), L2PcInstance:PlayerB[268502904]
    [23 Jun 22:02:17] CREATE:Buy, item 268580498:Necklace of Valakas(1), L2PcInstance:PlayerC[268483139]
    [23 Jun 22:02:25] SETOWNER:Drop, item 268580498:Necklace of Valakas(1), L2PcInstance:PlayerC[268483139]
    [23 Jun 22:02:33] SETOWNER:Pickup, item 268580498:Necklace of Valakas(1), L2PcInstance:PlayerD[268543953]
    
  6. ShinichiYao

    I log only equippable items to reduce disk usage. But it still missing informations.

    Is there any way to log mail attached items? For example sender, receiver, receive time, mail reject, receive failed because not at peace zone or user canceled or not enough Adena or whatever?

    I still believe something not handled in mail system cause this issue.

  7. ShinichiYao

    Could it cause by "Lazy Items Update" and "Update Items On Char Store"? Which could change the order of item save. @DoctorVal did you enable these two options?

  8. ShinichiYao

    gameserver/model/itemcontainer/Mail.java

    #!
    
        @Override
        public void deleteMe()
        {
            _items.forEach(i ->
            {
                i.updateDatabase(true);
                i.deleteMe();
                L2World.getInstance().removeObject(i);
                // Could cause exist item's ObjectId release?
                // IdFactory.getInstance().releaseId(i.getObjectId());
            });
            _items.clear();
        }
    

    Never happened again after this change.

  9. Log in to comment