# Employee Registration - Error: Internal Server Error (500)

**URL:** <https://forum.getodk.org/t/employee-registration-error-internal-server-error-500/6999>\
**Category:** Support\
**Tags:** odk-aggregate\
**Created:** [June 22, 2017, 10:39am UTC](https://forum.getodk.org/t/employee-registration-error-internal-server-error-500/6999 "2017-06-22T10:39:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TARIQUE010](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/t/0ea827/32.png) [@TARIQUE010](https://forum.getodk.org/u/TARIQUE010)\
**Post date:** [June 22, 2017, 10:39am UTC](https://forum.getodk.org/t/employee-registration-error-internal-server-error-500/6999/1 "2017-06-22T10:39:17Z")

</div>

When i try to upload my documents through the ODK app it worked well, but after few changes to the code i got this error Employee Registration - Errorr: Internal Server Error (500) http://......./submission?deviceID=imei%........ So please help me since i am just a beginner

Code :

```auto
vi md5.sh
#!/bin/bash
echo -n $1 | md5sum | awk '{print $1}'
chmod 555 md5.sh

./md5.sh "fb:odk ODK Aggregate:happy"

digest_auth=`echo -n $username:$realm:$passwd |md5sum |awk '{print $1}'`

newuser()
,
 _user_granted_authority  
 _registered_users

CREATE OR REPLACE FUNCTION create_ID(un text,pass text,role_allocate text) RETURNS void AS $$
DECLARE
BEGIN 
  INSERT INTO 
    rh._registered_users_test("_URI","_CREATOR_URI_USER","_CREATION_DATE","_LAST_UPDATE_URI_USER","_LAST_UPDATE_DATE","LOCAL_USERNAME","DIGEST_AUTH_PASSWORD","IS_REMOVED")
    VALUES
        (concat('uid:',un,'|',now()),'uid:admin|2015-12-22T14:22:47.437+0000',now(),'uid:admin|2015-12-22T14:22:47.437+0000',now(),un,md5(concat(un,':odk ODK Aggregate:',pass)),'f');

  INSERT INTO 
    rh._user_granted_authority_test("_URI","_CREATOR_URI_USER","_CREATION_DATE","_LAST_UPDATE_URI_USER","_LAST_UPDATE_DATE","USER","GRANTED_AUTHORITY")
    VALUES
        (concat('uid:',un,'|',now()),'uid:admin|2015-12-22T14:22:47.437+0000',now(),'uid:admin|2015-12-22T14:22:47.437+0000',now(),un,role_allocate);
END;
$$ language plpgsql;

DO $$ BEGIN
    PERFORM create_ID('fb','happy','GROUP_DATA_COLLECTORS');
END $$;
=========================================================
CREATE OR REPLACE FUNCTION _fb_create_ID() RETURNS trigger AS $$
DECLARE
BEGIN 
  INSERT INTO 
    rh._registered_users_test("_URI","_CREATOR_URI_USER","_CREATION_DATE","_LAST_UPDATE_URI_USER","_LAST_UPDATE_DATE","LOCAL_USERNAME","DIGEST_AUTH_PASSWORD","IS_REMOVED")
    VALUES
        (concat('uid:',NEW.EID,'|',now()),'uid:admin|2015-12-22T14:22:47.437+0000',now(),'uid:admin|2015-12-22T14:22:47.437+0000',now(),NEW.EID,md5(concat(NEW.EID,':odk ODK Aggregate:',NEW.EID)),'f');

  INSERT INTO 
    rh._user_granted_authority_test("_URI","_CREATOR_URI_USER","_CREATION_DATE","_LAST_UPDATE_URI_USER","_LAST_UPDATE_DATE","USER","GRANTED_AUTHORITY")
    VALUES
        (concat('uid:',NEW.EID,'|',now()),'uid:admin|2015-12-22T14:22:47.437+0000',now(),'uid:admin|2015-12-22T14:22:47.437+0000',now(),NEW.EID,'GROUP_DATA_COLLECTORS');
	RETURN new;
END;
$$ language plpgsql;

CREATE TRIGGER __fb_er_upload_master_trig
     AFTER INSERT ON rehash7."_fb_uploaded_registrations"
     FOR EACH ROW
     EXECUTE PROCEDURE _fb_create_ID();

select * from _registered_users_test;
select * rehash7._user_granted_authority_test;

```

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 27, 2017, 12:50am UTC](https://forum.getodk.org/t/employee-registration-error-internal-server-error-500/6999/2 "2017-06-27T00:50:40Z")

</div>

Hi there! I'm not sure of the question you are asking. It sounds like you changed the underlying PostgreSQL database in your Aggregate install and it's now not accepting submissions. Is that correct?
