EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=588)
-   -   Server is up and running, but there's no inventory (https://www.eqemulator.org/forums/showthread.php?t=31909)

Posix 08-23-2010 08:05 PM

Server is up and running, but there's no inventory
 
Greetings,

I have compiled and gotten running two servers on two different OSes, and both are experiencing the exact same problem: I can log in, create a character, interact with NPC's, and wander about the world without any issues. However, I have no inventory.

When I start up my server, I see a message about items loading:

Code:

[Status] Loading items from database: count=83375
Everything looks ok, more debug messages go by, nothing alarming...

The world log captures:
Code:

41544 [08.23. - 15:38:31] Starting Log: logs/eqemu_world.log
41544 [08.23. - 15:38:31] Using database 'eqemu' at localhost:3306
41544 [08.23. - 15:38:31] libEMuShareMem.so loaded
41544 [08.23. - 15:38:31] Loading items from database: count=83375

Everything looks good. I am able to log in, create my character, and start running around the world, except my inventory is empty.

Digging through the logs, I find in files logs/zone-dynamic_0n (where 1 <= n <= 5):
Code:

[Debug] Starting Log: logs/eqemu_debug_zone.log
[Debug] [ZONE__INIT] Loading server configuration..
[Debug] [ZONE__INIT] Warning: Unable to read log.ini
[Debug] [ZONE__INIT] Connecting to MySQL...
[Status] Starting Log: logs/eqemu_zone.log
[Status] Using database 'eqemu' at localhost:3306
[Debug] [ZONE__INIT] CURRENT_ZONE_VERSION: EQEmulator 0.8.0
[Debug] [COMMON__THREADS] Starting DBAsyncLoop with thread ID 26223568
[Debug] [ZONE__INIT] Warning: Unable to read ./log.ini
[Debug] [ZONE__INIT] Mapping Incoming Opcodes
[Debug] [ZONE__INIT] Loading Variables
[Debug] [ZONE__INIT] Loading zone names
[Debug] [ZONE__INIT] Loading items
[Error] Starting Log: logs/eqemu_error_zone.log
[Error] LoadEMuShareMemDLL::Load() failed to attach Items.GetItem
[Debug] [ZONE__INIT_ERR] Loading items FAILED!
[Debug] [ZONE__INIT] Failed.  But ignoring error and going on...

[Debug] [ZONE__INIT] Loading npc faction lists
[Status] libEMuShareMem.so loaded
failed to get 0-length shared mem: Function not implemented
shmat failed! Function not implemented
[Warning] Could not attach to shared memory proceeding on isolated memory (share
_id <= 0)
[Status] Loading NPC Faction Lists from database...
[Debug] [ZONE__INIT] Loading loot tables
failed to get 0-length shared mem: Function not implemented
shmat failed! Function not implemented
[Warning] Could not attach to shared memory proceeding on isolated memory (share_id <= 0)
[Status] Loading Loot tables from database...
[Debug] [ZONE__INIT] Loading skill caps
failed to get 0-length shared mem: Function not implemented
shmat failed! Function not implemented
[Warning] Could not attach to shared memory proceeding on isolated memory (share_id <= 0)
[Status] Loading skill caps from database...
[Debug] [ZONE__INIT] Loading spells
failed to get 0-length shared mem: Function not implemented
shmat failed! Function not implemented
[Warning] Could not attach to shared memory proceeding on isolated memory (share_id <= 0)
[Debug] [ZONE__INIT] Loading guilds
[Debug] [ZONE__INIT] Loading factions
[Debug] [ZONE__INIT] Loading titles
[Debug] [ZONE__INIT] Loading AA effects
[Debug] [ZONE__INIT] Loading tributes
[Debug] [ZONE__INIT] Loading corpse timers
[Debug] [ZONE__INIT] Loading commands
[Debug] command_init(): - Command 'acceptrules' set to access level 0.
...
[Debug] command_init(): - Command 'zuwcoords' set to access level 80.
[Debug] [ZONE__INIT] 238 commands loaded
[Debug] [ZONE__INIT] Loaded default rule set 'default'
[Debug] [ZONE__INIT] Loading Tasks
[Debug] [ZONE__INIT] Loading embedded perl XS
[Debug] [ZONE__INIT] Loading quests
[Quest] Starting Log: logs/eqemu_quest_zone.log
[Quest] Tying perl output to eqemu logs
[Quest] Creating EQEmuIO=HASH(0x806818888)
[Quest] Creating EQEmuIO=HASH(0x806818ee8)
[Quest] Loading perlemb plugins.
[Quest] Unable to read perl file 'plugin.pl'
[Quest] Loading perl commands...
[Quest] Unable to read perl file 'commands.pl'

I suspect something may not have compiled right, based on the highlighted error, but I can't seem to find anything that jumps out at me in the file common/SharedLibrary.cpp where the highlighted error above seems to be stemming from.

I built the server binaries from source from August 12:
Code:

svn checkout http://projecteqemu.googlecode.com/svn/trunk/ eqemu
The database I have is peqdb_rev1589.sql, obtained from http://www.projecteq.net/, which as far as I can tell is the latest and the one that should go with the current source.

Any thoughts on where I might be going wrong?

Thanks for any help.

pfyon 08-23-2010 09:21 PM

What OSes have you been using?

Posix 08-24-2010 01:28 AM

Ubuntu 10.04.1 and FreeBSD 7.2-p8 jail, both AMD 64-bit.
Sometimes Zones core-dumps on the Ubuntu system.
Aside from the no-items issue, it runs rock-solid on the FreeBSD system.

pfyon 08-24-2010 08:14 AM

Ah, 64 bit. As far as I know, everything doesn't work perfectly with 64 bit eqemu yet. There may be some other people who have posted about their experiences here.

amraist 08-24-2010 08:33 AM

I've been running on FreeBSD amd64 in a jail(7.x-8.x), for quite a while without any noticable issues.
Are you using erde's autobuild scripts here? I'm assuming since you got it to compile you are at least using the freebsd patch included there.

You will need this additional patch as well:
Code:

--- common/SharedLibrary.cpp    2009-10-19 14:58:05.000000000 +0000
+++ common/SharedLibrary.cpp.new        2009-10-19 15:44:46.000000000 +0000
@@ -83,10 +83,10 @@
                return(NULL);
       
        void *r = GetProcAddress(hDLL, name);
-
-      if(GetError() != NULL)
-              r = NULL;
-
+      if ( r == NULL ) {
+              const char *load_error = GetError();
+              fprintf(stderr, "[Error] Shared Library GetSym: '%s' failed.  Error=%s\n", name, load_error?load_error:"Null Return, no error");
+      }
        return(r);
 }

You will also need a line like this in your rc.conf file of the system hosting your jails:
Code:

jail_sysvipc_allow="YES"

Posix 08-24-2010 02:31 PM

Thanks, amraist!
No, my Google-Fu and Search-Fu were weak, as all I came across were people lamenting how EQEmu didn't work in FreeBSD from a few years ago. And that just wouldn't do!
I did not previously find erde's scripts or patches, I used gmake with the default makefiles, which seemed to work with some slight tweaking:
Code:

--- world/makefile  2010-08-13 10:39:18.000000000 -0700
+++ world/makefile  2010-08-13 13:39:56.000000000 -0700
@@ -1,7 +1,7 @@

-HCC=$(shell ccache -V 2>/dev/null)
+HCC=$(shell ccache-swig -V 2>/dev/null)
 ifneq (,$(findstring version,$(HCC)))
-      CC=ccache gcc
+      CC=ccache-swig gcc
 else
        CC=gcc
 endif
@@ -11,7 +11,7 @@
 OUT=-o
 LINKOUT=-o
 NOLINK=-c
-DFLAGS=-DDEBUG=5 -DEQDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -DIRC -Di386 -DAPP_OPCODE_SIZE=2
+DFLAGS=-DDEBUG=5 -DEQDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -DIRC -DAPP_OPCODE_SIZE=2 -DFREEBSD -D__x86_64__
 WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wcomment -Wcast-align -Wno-deprecated

 PERL_FLAGS=$(shell perl -MExtUtils::Embed -e ccopts)
@@ -21,9 +21,9 @@
 MYSQL_FLAGS=$(shell mysql_config --cflags)
 MYSQL_LIB=$(shell mysql_config --libs)

-COPTS=$(WFLAGS) -g -march=i686 -O -pthread -pipe -I../common/SocketLib \
+COPTS=$(WFLAGS) -ggdb -march=native -pthread -pipe -I../common/SocketLib \
  -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD $(DFLAGS) $(MYSQL_FLAGS) $(PERL_FLAGS)
-LINKOPTS=$(COPTS) -rdynamic -L. -lstdc++ -lm -lz -ldl \
+LINKOPTS=$(COPTS) -rdynamic -L. -lstdc++ -lm -lz \
  $(MYSQL_LIB) $(PERL_LIB)

 all: world

pretty much the same change to the zone and eqlauncher makefiles.
Then I made a couple changes to the code which seemed to get it to compile and run allright:
Code:

--- common/Mutex.cpp    2010-08-12 10:39:24.000000000 -0700
+++ common/Mutex.cpp  2010-08-12 17:35:08.000000000 -0700
@@ -77,7 +77,7 @@
 #if defined(__CYGWIN__) || defined(__APPLE__)
        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 #else
-      pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+      pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 #endif
        pthread_mutex_init(&CSMutex, &attr);
        pthread_mutexattr_destroy(&attr);

and a curious case with how money is handled:
Code:

--- zone/client.cpp      2010-08-12 10:40:42.000000000 -0700
+++ zone/client.cpp      2010-08-12 17:50:28.000000000 -0700
@@ -40,7 +40,6 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include "../common/unix.h"
-#define abs64 abs
 #endif

 extern volatile bool RunLoops;
@@ -2017,7 +2016,7 @@
                copperpp -= copper;
                if(copperpp <= 0)
                {
-                      copper = abs64(copperpp);
+                      copper = copperpp * -1;
                        m_pp.copper = 0;
                }
                else
@@ -2029,7 +2028,7 @@
                silver -= copper;
                if(silver <= 0)
                {
-                      copper = abs64(silver);
+                      copper = silver * -1;
                        m_pp.silver = 0;
                }
                else
@@ -2044,7 +2043,7 @@

                if(gold <= 0)
                {
-                      copper = abs64(gold);
+                      copper = gold * -1;
                        m_pp.gold = 0;
                }
                else

since the value of the money variable is already known to be below 0 (negative), and I'm not seeing anywhere in there you could end up with an imaginary number, I just flip the sign instead of going through the trouble of getting an absolute value.

I'll be pouring over those patches, see how it stacks up to what I was muddling through :)

amraist 08-24-2010 03:54 PM

The bsd.patch included with erde's autobuild scripts will fix the odd coin issue you are having, and also the mutex fix. The scripts may be out of date with the current svn, but its pretty simple to fix them. You just have to track down a new file or two and add it to one of the files included.

Posix 08-24-2010 04:45 PM

Yep. The link in the thread you pointed me to no longer works, but I found the latest version here.

I still needed to fix the issue with trying to use THREAD_MUTEX_RECURSIVE_NP instead of PTHREAD_MUTEX_RECURSIVE (easy fix, that), but everything else seems to be going well. I also noticed there was a new svn release the other day, so I'm trying this out with a fresh code base.

And no dice.:
Code:

embperl.o(.text+0xcf1): In function `xs_init':
: undefined reference to `boot_Object'
*** Error code 1

Seeing what I can do to track this one down. A missing XSLT header file, perhaps?

Posix 08-24-2010 05:09 PM

Upon further thought, a missing library makes no sense, as it was compiling using the default makefiles, and I have verified the presence of a defined symbol "boot_Object" in my already compiled zone. There must be a missing include somewhere.

Posix 08-24-2010 06:33 PM

Found it! zone/perl_object.cpp was not being compiled. Added an entry into the Makefile (and the Makefile.in and Makefile.am in the parent zone directory for future proofing) for perl_object and now it compiles and runs as expected.

Still getting an error, though:
Code:

[Error] Starting Log: logs/eqemu_error_zone.log
[Error] LoadEMuShareMemDLL::Load() failed to attach Items.GetItem
[Debug] [ZONE__INIT_ERR] Loading items FAILED!
[Debug] [ZONE__INIT] Failed.  But ignoring error and going on...

I'm going to guess items are still missing. :/ Oh wel, guess I'll keep plugging away at this...

amraist 08-24-2010 06:38 PM

Did you apply the SharedLibrary patch above and add the line to your jail host rc.conf? I'm sure that will fix your issue.

Posix 08-24-2010 08:03 PM

Yep, caught that after the last post. Now it's core-dumping:
Code:

cazic-thule> world
[Debug] Starting Log: logs/eqemu_debug_world.log
[Debug] [WORLD__INIT] Loading server configuration..
[Debug] [WORLD__INIT] Log settings loaded from log.ini
[Debug] [WORLD__INIT] CURRENT_WORLD_VERSION:EQEmulator 0.8.0
[Debug] [WORLD__INIT] Added loginserver duckberg.home:5998
[Debug] [WORLD__INIT] Connecting to MySQL...
[Status] Starting Log: logs/eqemu_world.log
[Status] Using database 'eqemu' at localhost:3306
[Debug] [WORLD__INIT] HTTP world service disabled.
[Debug] [WORLD__INIT] Loading variables..
[Debug] [COMMON__THREADS] Starting DBAsyncLoop with thread ID 24127216
[Debug] [WORLD__INIT] Loading zones..
[Debug] [WORLD__INIT] Clearing groups..
[Debug] [WORLD__INIT] Clearing raids..
[Debug] [WORLD__INIT] Loading items..
[Status] libEMuShareMem.so loaded
[Warning] requested shared memory of size:70848780 but that Key is already in use with size:1
[Warning] Attempting resize
[Error] Failed to resizeInvalid argument
Segmentation fault (core dumped)
cazic-thule>

I'm going to guess that the host system must be rebooted in order for security.jail.sysvipc_allowed to work properly (can't just say 'sysctl security.jail.sysvipc_allowed = 1'). Which will have to wait, as this unit also serves up DNS, CIFS, LDAP, HTTP, and I'm sure another half-dozen or so services I've long since forgotten about <:)

Posix 08-24-2010 10:51 PM

No luck. Still core dumping after reboot.

amraist 08-24-2010 11:08 PM

Forgot you will also need this in your jail host's /etc/sysctl.conf
Code:

#For EQEmu
kern.ipc.shmall=65536
kern.ipc.shmmax=134217728
#For EQEmu in a jail
security.jail.sysvipc_allowed=1

Reboot or use sysctl as necessary.

Posix 08-25-2010 01:42 PM

Thanks! It was kern.ipc.shmall that I was missing (64k is all it takes?). I was up late playing with values of shmmax (currently at 512M) and shmmin (currently back to default of 1).

I don't see any more errors regarding item loading, and it took a lot longer this time. Things are looking good!

Posix 08-25-2010 06:50 PM

Everything is looking good; I have inventory, and things appear to be running smoothly. Thanks for the help amraist!

Looking over erde's BSD patches, I see I did almost exactly what erde did, except instead of switching up to an equivalent abs function, I opted to simply flip the sign of the integers, given they're all known to be below 0 and there's no even-root calls. :)

amraist 08-26-2010 08:40 AM

Glad to hear its working for you. I have a startup script I wrote if you are interested. It works except on startup it seems(last time my jail started, my launcher didn't startup), and I haven't gotten around to tracking that down.

Posix 08-26-2010 08:39 PM

I certainly won't turn down free startup scripts :)

It seems I may have spoken too soon about everything working great. In my last post, I logged in, saw I had inventory, figured everything was great, logged out and went to sleep. Since, I have discovered I am now unable to move, or if I can move there's no gravity. And no sky. I suspect something is up with the zone launch script.

amraist 08-27-2010 09:43 AM

Did download the maps?

Derision 08-27-2010 11:10 AM

Since your source is at a higher revision than your database, you should check:

http://code.google.com/p/projecteqem.../utils/sql/svn

for any SQL with prefixes between your database and source revision numbers and source them into your database.

The particular problem you are having likely requires:

http://code.google.com/p/projecteqem...svn1618&r=1618

Posix 08-27-2010 12:09 PM

OK, I think I'm starting to understand the correlation between DB and EQEmu revisions here, perhaps you can confirm?

Even when doing a brand-new install, simply installing the base peqdb as obtained via CVS is not sufficient. The super-mega DB, peqdb_rev1589.sql, is applied. Then, any sql file with a revision number listing in the utils/sql/svn directory of the source is applied? I just want to make sure I understand this going forward.

Thank you for the help!

Derision 08-27-2010 01:04 PM

When Cavedude releases a version of the PEQ database, it is generally compatible with the current version of the server source code on the day he releases it.

As a new PEQ database is only generally released every month or two, any source code changes that are made in between PEQ DB releases, that require a database change,
will require you to source in the changes from the source code SVN, utils/sql/svn directory.

E.g. July 9th, CD releases PEQ DB Rev 1589, compatible with the latest available source code on that date, Rev 1589.

Source code developers commit changes over the following days and weeks, some of which require database changes, e.g. I commit source
Rev 1618 on 8th August which requires a change to the zone table structure.

If you upgrade from Rev 1589 to Rev 1618 of the source (or are a new user who has just installed the Rev1589 DB and compiled the Rev1618 source),
then you will need to apply any SQL changes that have have prefixes betwen 1590 and 1618 from the source code SVN.

trevius 08-27-2010 02:05 PM

You only want to apply any SQL from that folder for revisions that came AFTER the db revision you are running. So, in your case that would be any SQL higher than 1589. Also, if there are any SQL files for a revision LATER than the actual source code revision you are running, you do not want to apply those.

Posix 08-28-2010 03:17 AM

Thanks, both of those explanations make a lot of sense.

With those sql updates applied, the world and zones are now running properly.
I can move.
I can interact with NPC's.
I have inventory.
There is gravity.
There is sky.
There is combat.
There is a brass key.

> get key

amraist 08-29-2010 09:44 AM

Here is my startup script. It will start world, ucs, eqlogin(login server) and will use eqlauncher to start up zones. So you will need to have one setup in the database. If you notice any bugs, please let me know.

Code:

#!/bin/sh

# PROVIDE: eqemu
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="eqemu"
start_cmd="${name}_start $2"
stop_cmd="${name}_stop $2"
restart_cmd="${name}_restart $2"
status_cmd="${name}_status $2"
extra_commands="status cleanipc"
determine_procs_cmd="eqemu_determine_procs"
cleanipc_cmd="${name}_cleanipc"
eqemu_enable=${eqemu_enable:-"YES"}
eqemu_home=${eqemu_home:-"/usr/local/eqemu"}
eqemu_user=${eqemu_user:-"eqemu"}
eqemu_group=${eqemu_group:-"eqemu"}
eqemu_world=${eqemu_world:-"NO"}
eqemu_eqlaunch=${eqemu_eqlaunch:-"NO"}
eqemu_eqlaunch_args=${eqemu_eqlaunch_args:-"zone"}
eqemu_ucs=${eqemu_ucs:-"NO"}
eqemu_eqlogin=${eqemu_eqlogin:-"NO"}
eqemu_world_args=${eqemu_world_args:-""}
eqemu_eqlogin_args=${eqemu_eqlogin_args:-""}
eqemu_ucs_args=${eqemu_ucs_args:-""}
rcvar=`set_rcvar`
load_rc_config $name

eqemu_determine_procs()
{
        unset "eqemu_procs"
        if  [ "${_rc_prefix}" = "one" ]  ; then
                case "$1" in
                        eqlogin)
                                eqemu_procs=$1
                                ;;
                        world)
                                eqemu_procs=$1
                                ;;
                        eqlaunch)
                                eqemu_procs=$1
                                ;;
                        ucs)
                                eqemu_procs=$1
                                ;;
                        *)
                                echo "Usage: ./eqemu one(start|stop|restart) (world|eqlaunch|ucs|eqlogin) you must also specify a valid daemon."
                                ;;
                esac
        else
                if checkyesno eqemu_eqlogin ; then
                        eqemu_procs="${eqemu_procs}eqlogin "
                fi
                if checkyesno eqemu_world ; then
                        eqemu_procs="${eqemu_procs}world "
                fi
                if checkyesno eqemu_eqlaunch ; then
                        eqemu_procs="${eqemu_procs}eqlaunch "
                fi
                if checkyesno eqemu_ucs ; then
                        eqemu_procs="${eqemu_procs}ucs "
                fi
        fi
}
eqemu_cleanipc()
{
        eqemu_procs="world eqlaunch zone"
        for proc in ${eqemu_procs}; do
                if [ "`check_pidfile /var/run/eqemu${proc}.pid $eqemu_home/$proc`" != "" ] ; then
                        echo "Processes running; skipping cleanipc..."
                        return
                fi
        done
        echo "Cleaning IPC..."
        ${eqemu_home}/cleanipc > /dev/null 2>&1
}
eqemu_start()
{
        eqemu_determine_procs $1
        for name in ${eqemu_procs}; do
                echo "Starting EQEmu ${name}..."
                cd ${eqemu_home}
                eval eqprocargs=\$eqemu_${name}_args
                if ! [ -e /var/run/eqemu_${name}.pid ]; then
                        touch /var/run/eqemu_${name}.pid
                        chown $eqemu_user:$eqemu_user /var/run/eqemu_${name}.pid
                fi
                /usr/sbin/daemon -f -p /var/run/eqemu_${name}.pid -u $eqemu_user $eqemu_home/$name $eqprocargs
        done
}
eqemu_stop()
{
        unset "stop_cmd"
        eqemu_determine_procs $1
        eqemu_procs=$(reverse_list ${eqemu_procs})
        for name in ${eqemu_procs}; do
                command=$eqemu_home/$name
                run_rc_command stop
        done
}
eqemu_restart()
{
        eqemu_restart_prefix=${_rc_prefix}
        run_rc_command ${eqemu_restart_prefix}stop $1
        if [ "${eqemu_restart_prefix}" != "one" ] ; then run_rc_command ${_rc_prefix}cleanipc $1; fi
        run_rc_command ${eqemu_restart_prefix}start $1
}
eqemu_status()
{
        unset "status_cmd"
        eqemu_determine_procs $1
        for name in ${eqemu_procs}; do
                command=$eqemu_home/$name
                run_rc_command status
        done
}
                       
run_rc_command "$1"


morgoth2 09-07-2010 07:27 AM

Quote:

Originally Posted by Posix (Post 190934)
Found it! zone/perl_object.cpp was not being compiled. Added an entry into the Makefile (and the Makefile.in and Makefile.am in the parent zone directory for future proofing) for perl_object and now it compiles and runs as expected.

and exactly how did you do that? im haveing the same problem.

amraist 09-07-2010 09:38 AM

I use grep to find where the missing function is defined, and then add that file to the makefiles. You can also figure it out if you are paying attention to the svn logs. If you are using erde's autobuild, here is a patch you can apply after extracting and before running any of his autobuild commands:
Code:

Index: zone/Makefile.am
===================================================================
--- zone/Makefile.am (revision 33)
+++ zone/Makefile.am (revision 63)
@@ -221,6 +221,7 @@
        perl_mob.h \
        perl_npc.cpp \
        perl_npc.h \
+      perl_object.cpp \
        perl_perlpacket.cpp \
        perl_perlpacket.h \
        perl_PlayerCorpse.cpp \



All times are GMT -4. The time now is 03:39 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.