ProgrammingError at /search relation "dates" does not exist

124 views
Skip to first unread message

Piyush Shah

unread,
May 28, 2016, 9:51:38 AM5/28/16
to Arches Project
Hi,

I had installed Aches on my 64bit system and perform all the steps of the documentation but when I run the server and click on search link I get a below error: 


Environment:

Request Method: GET

Django Version: 1.6.2
Python Version: 2.7.6
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.gis',
 'arches',
 'arches.app.models',
 'arches.management',
 'arches_hip',
 'champ_hip')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'arches.app.utils.set_anonymous_user.SetAnonymousUser')


Traceback:
File "C:\CHAMP\lib\site-packages\django\core\handlers\base.py" in get_response
  114.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\CHAMP\lib\site-packages\arches_hip\views\search.py" in home_page
  35.     min_max_dates = models.Dates.objects.aggregate(Min('val'), Max('val'))
File "C:\CHAMP\lib\site-packages\django\db\models\manager.py" in aggregate
  166.         return self.get_queryset().aggregate(*args, **kwargs)
File "C:\CHAMP\lib\site-packages\django\db\models\query.py" in aggregate
  278.         return query.get_aggregation(using=self.db)
File "C:\CHAMP\lib\site-packages\django\db\models\sql\query.py" in get_aggregation
  356.         result = query.get_compiler(using).execute_sql(SINGLE)
File "C:\CHAMP\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql
  782.         cursor.execute(sql, params)
File "C:\CHAMP\lib\site-packages\django\db\backends\util.py" in execute
  69.             return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\CHAMP\lib\site-packages\django\db\backends\util.py" in execute
  53.                 return self.cursor.execute(sql, params)
File "C:\CHAMP\lib\site-packages\django\db\utils.py" in __exit__
  99.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\CHAMP\lib\site-packages\django\db\backends\util.py" in execute
  53.                 return self.cursor.execute(sql, params)

Exception Type: ProgrammingError at /search
Exception Value: relation "dates" does not exist
LINE 1: ...AS "val__max", MIN("dates"."val") AS "val__min" FROM "dates"
                                                                ^
So kindly help me what wrong I had done in installation.

Regards,
Piyush

Vincent Meijer

unread,
May 28, 2016, 3:40:03 PM5/28/16
to Arches Project
I got the same error after I installed from the master branch in Github (instead of "pip install arches"). The latest tag/release worked fine for me. 

How did you install?

Vincent

Piyush Shah

unread,
Jun 2, 2016, 12:57:20 AM6/2/16
to arches...@googlegroups.com
I had install using "pip install arches"

Alexei Peters

unread,
Jun 2, 2016, 12:34:50 PM6/2/16
to Piyush Shah, Arches Project
It doesn't look like the database tables are getting installed correctly.
Can you run the following command from an activated environment?
python manage.py packages -o install



Director of Web Development - Farallon Geographics, Inc. - 971.227.3173

On Wed, Jun 1, 2016 at 9:57 PM, Piyush Shah <piyus...@gmail.com> wrote:
I had install using "pip install arches" only

--
-- To post, send email to arches...@googlegroups.com. To unsubscribe, send email to archesprojec...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en
---
You received this message because you are subscribed to the Google Groups "Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to archesprojec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Piyush Shah

unread,
Jun 4, 2016, 12:44:28 AM6/4/16
to Arches Project
Thank you Alexei for your reply !

When I run above command it raise below error after "VACUUM"

VACUUM
Traceback (most recent call last):
  File "manage.py", line 28, in <module>
    execute_from_command_line(sys.argv)
  File "C:\CHAMP\lib\site-packages\django\core\management\__init__.py", line 399
, in execute_from_command_line
    utility.execute()
  File "C:\CHAMP\lib\site-packages\django\core\management\__init__.py", line 392
, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\CHAMP\lib\site-packages\django\core\management\base.py", line 242, in
 run_from_argv
    self.execute(*args, **options.__dict__)
  File "C:\CHAMP\lib\site-packages\django\core\management\base.py", line 285, in
 execute
    output = self.handle(*args, **options)
  File "C:\CHAMP\lib\site-packages\arches\management\commands\packages.py", line
 73, in handle
    self.install(package_name)
  File "C:\CHAMP\lib\site-packages\arches\management\commands\packages.py", line
 126, in install
    install()
  File "C:\CHAMP\champ_hip\champ_hip\setup.py", line 6, in install
    setup.install()
  File "C:\CHAMP\lib\site-packages\arches_hip\setup.py", line 18, in install
    truncate_db()
  File "C:\CHAMP\lib\site-packages\arches_hip\setup.py", line 44, in truncate_db

    management.call_command('packages', operation='setup_db')
  File "C:\CHAMP\lib\site-packages\django\core\management\__init__.py", line 159
, in call_command
    return klass.execute(*args, **defaults)
  File "C:\CHAMP\lib\site-packages\django\core\management\base.py", line 285, in
 execute
    output = self.handle(*args, **options)
  File "C:\CHAMP\lib\site-packages\arches\management\commands\packages.py", line
 76, in handle
    self.setup_db(package_name)
  File "C:\CHAMP\lib\site-packages\arches\management\commands\packages.py", line
 211, in setup_db
    self.create_groups()
  File "C:\CHAMP\lib\site-packages\arches\management\commands\packages.py", line
 252, in create_groups
    edit_group = Group.objects.create(name='edit')
  File "C:\CHAMP\lib\site-packages\django\db\models\manager.py", line 157, in cr
eate
    return self.get_queryset().create(**kwargs)
  File "C:\CHAMP\lib\site-packages\django\db\models\query.py", line 319, in crea
te
    obj.save(force_insert=True, using=self.db)
  File "C:\CHAMP\lib\site-packages\django\db\models\base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)
  File "C:\CHAMP\lib\site-packages\django\db\models\base.py", line 570, in save_
base
    with transaction.commit_on_success_unless_managed(using=using, savepoint=Fal
se):
  File "C:\CHAMP\lib\site-packages\django\db\transaction.py", line 500, in commi
t_on_success_unless_managed
    if connection.get_autocommit() or connection.in_atomic_block:
  File "C:\CHAMP\lib\site-packages\django\db\backends\__init__.py", line 324, in
 get_autocommit
    self.ensure_connection()
  File "C:\CHAMP\lib\site-packages\django\db\backends\__init__.py", line 124, in
 ensure_connection
    self.connect()
  File "C:\CHAMP\lib\site-packages\django\db\backends\__init__.py", line 113, in
 connect
    self.init_connection_state()
  File "C:\CHAMP\lib\site-packages\django\db\backends\postgresql_psycopg2\base.p
y", line 119, in init_connection_state
    self.connection.cursor().execute("SET search_path TO " + settings_dict['SCHE
MAS'])
KeyError: 'SCHEMAS'

Regards,
Piyush

On Saturday, 28 May 2016 19:21:38 UTC+5:30, Piyush Shah wrote:

Adam Cox

unread,
Jun 8, 2016, 10:58:00 AM6/8/16
to Arches Project
Hello Piyush, like Alexei said, it sounds like the database tables didn't install correctly.  I'd recommend that you restart the process from the virtual environment creation step while using a command prompt as administrator.  Here' s how to do that https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=run%20command%20prompt%20as%20administrator.  While I didn't need to do this with Windows 7, I've found it to be necessary with Windows 10, and I don't know about 8.

Hope that helps,
Adam

Piyush Shah

unread,
Jun 11, 2016, 2:17:13 AM6/11/16
to Adam Cox, Arches Project
Thank you Alexei for your reply !

I had perform all the steps using a command prompt as administrator but still I am facing same problem.

I am using windows 8.1

Regards,
Piyush

--
-- To post, send email to arches...@googlegroups.com. To unsubscribe, send email to archesprojec...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Arches Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/archesproject/7I0U9zYZX-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to archesprojec...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Piyush M Shah

GIS Professional


M.Sc (Geomatics and Space Application), M.Sc (IT and CA)

Phone: +91-79-22860917

Mobile: 09408721451

Adam Cox

unread,
Jun 13, 2016, 11:34:19 AM6/13/16
to Arches Project
Hi Piyush, one thing I've suggested on a couple of other threads is to write the entire output of the pip install arches command to a text file.  Start with a new virtual environment, and try this command:

(ENV): pip install arches > arches_install_log.txt 2>&1

 Please share the resulting file and we can try to find where the installation went wrong.

Cheers,
Adam

--
-- To post, send email to arches...@googlegroups.com. To unsubscribe, send email to archesproject+unsubscribe@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Arches Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/archesproject/7I0U9zYZX-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to archesproject+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Piyush Shah

unread,
Jun 18, 2016, 1:59:04 AM6/18/16
to Adam Cox, Arches Project
Thank you Adam for your reply !

As per your suggestion I had written entire output of the pip install arches_hip command to a text file.

Please find enclosed attachment.

Regards,
Piyush

Adam

--
-- To post, send email to arches...@googlegroups.com. To unsubscribe, send email to archesprojec...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Arches Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/archesproject/7I0U9zYZX-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to archesprojec...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Piyush M Shah

GIS Professional


M.Sc (Geomatics and Space Application), M.Sc (IT and CA)

Phone: +91-79-22860917

Mobile: 09408721451

--
-- To post, send email to arches...@googlegroups.com. To unsubscribe, send email to archesprojec...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Arches Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/archesproject/7I0U9zYZX-U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to archesprojec...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
arches_install_log.txt

Alexei Peters

unread,
Jun 18, 2016, 6:55:38 PM6/18/16
to Piyush Shah, Adam Cox, Arches Project
Hi Piyush,
I'm suspect that you might not have activated your virtual environment before you ran that command.
Try that and see if it fixes things.
Cheers,
Alexei


Director of Web Development - Farallon Geographics, Inc. - 971.227.3173

You received this message because you are subscribed to the Google Groups "Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to archesprojec...@googlegroups.com.

Adam Cox

unread,
Jun 20, 2016, 2:38:03 PM6/20/16
to Alexei Peters, Piyush Shah, Arches Project
Hi Piyush, I suspect you may need to upgrade pip.  The permissions error with that txt file has been fixed for me before after upgrading pip.  With your ENV activated, use this command
python -m pip install -U pip
And then try pip installing Arches and Arches-HIP again.  Write the output to the text file as before, so that we can see the results.

Good luck!
Adam

Piyush Shah

unread,
Jun 21, 2016, 12:15:44 AM6/21/16
to Adam Cox, Alexei Peters, Arches Project
Thank you Adam!

Surely I will do it and revert you back.

Regards,

Piyush Shah

unread,
Jun 25, 2016, 1:56:40 AM6/25/16
to Adam Cox, Alexei Peters, Arches Project
Hi Adam,

I had run the command which you mention in your previous mail but No success, still I am facing same issue.

I am sharing you the output text file.

Thanks & Regards,
arches_install_log.txt

Vincent Meijer

unread,
Jun 29, 2016, 11:08:14 AM6/29/16
to Arches Project
Hello Piyush,

Could you please confirm that you activated your virtual environment before you ran the command (as Alexei suggested)? 
That would make a big difference in how to approach this issue.

Also, it would make it easier for us to help if you if you could post the exact commands that you used from the start. That way we can see if anything went wrong along the way.


Thanks!
Vincent

Piyush Shah

unread,
Jul 2, 2016, 1:56:37 AM7/2/16
to Vincent Meijer, Arches Project
Hi Vincent,

Thank you for your reply!

I am sharing you all the commands I had performed for installing Arches from virtual environment creation with screenshots.

Step 1) Create a virtual environment
Inline image 1

Step 2) Activated virtual environment
Inline image 2

Step 3) Installed the arches_hip module (I had attached arches_install_log.txt with this post)
Inline image 3

Step 4) Create the folder for HIP customization
Inline image 5

Step 5) Changing the settings.py 
Inline image 6

Step 6) Installed the ElasticSearch
Inline image 7

Step 7) Started ElasticSearch:
Inline image 8

Step 8) Created Database
Inline image 9
Inline image 10

Step 9) Run arches
Inline image 11

Step 10) Open the search page (http://localhost:8000/search) into the browser
Inline image 12

Regards,
arches_install_log.txt

Vincent Meijer

unread,
Jul 7, 2016, 9:52:46 AM7/7/16
to Arches Project
Hi Piyush,

Sorry for getting back to you so late. I was scanning monuments in Spain :)

Your problem may lie in the name of your virtualenv: the software seems to expect the folder to be called "ENV". 

The other thing might be the location of your arches_hip customization folder (champ_hip), although I'm not sure if that matters. 
The folder structure described in the installation guide is this:
/Projects
  /ENV
  /my_hip_app     (your "champ_hip")
While what you have is:
/C:
  /champv2        (should be ENV)
      /champ_hip  (should be on the same level as ENV)
With installations like these, it is often very important to follow the installation guide exactly :)

Let me know if this solves the problem!

Vincent

Piyush Shah

unread,
Jul 7, 2016, 9:56:19 AM7/7/16
to Vincent Meijer, Arches Project
Thank you Vincent for Reply !

I will again perform all the steps with all the suggestion you mention in your previous post and get back to you.

Regards,

Piyush Shah

unread,
Jul 9, 2016, 1:37:44 AM7/9/16
to Vincent Meijer, Arches Project
Hi Vincent,

I had perform all the steps again considering your folder structure suggestion, but no success still I am getting same error only.

Thanks & Regards,

Vincent Meijer

unread,
Jul 13, 2016, 11:56:22 AM7/13/16
to Arches Project
Hello Piyush,

Sorry I took so long. I tested the installation on my own Windows machine, and I had the exact same error (Could not open requirements file: [Errno 2] No such file or directory: 'c:\\Projects\\env\\Lib\\site-packages\\arches\\install\\requirements.txt').

This might be something the Arches team would want to look into :)


For me the problem was fixed when I installed Arches right before I installed Arches_hip:
pip install arches

I hope this helps,
Vincent

Adam Cox

unread,
Jul 13, 2016, 1:43:03 PM7/13/16
to Vincent Meijer, Arches Project
Vincent, I'm glad you were able to get this to work!  One thing I've noticed is that when installing with pip on windows, the initial "wheel building" install sequence does not work.  It results in something like this:


...[lots of earlier messages]...

Could not open requirements file: [Errno 2] No such file or directory: 'c:\\arches\\blanks\\env_new\\Lib\\site-packages\\arches\\install\\requirements.txt'
  You are using pip version 7.1.2, however version 8.1.2 is available.
  You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  error: c:\arches\blanks\env_new\Lib\site-packages\arches\install\django_overrides\base.py: No such file or directory

  ----------------------------------------
  Failed building wheel for arches
Failed to build arches
Installing collected packages: arches, arches-hip
  Running setup.py install for arches
Successfully installed arches-3.1.2 arches-hip-1.0.4

I think this is just a pip version thing but you'll see that after setup.py is used for the install, arches is actually installed successfully.  I see now that that may be what was ultimately what is going on for Piyush, and the "requirements.txt" error may be a red herring.  At any rate, you're correct, some more detailed Windows documentation would definitely be beneficial.  Hopefully this week!

Piyush, after poring over your screenshots (which are fantastically helpful) I think this problem stems from the way you are updating the database information in settings.py.  You have copied the entire dictionary from ..\site-packages\arches\settings.py and updated a few of the keys that you needed to change, but removed the others, specifically the 'SCHEMAS' key/value pair.  That is the specific error your are returning: a key error looking for 'SCHEMAS'.

You could fix this by adding that key value pair back in, but really I'd recommend using this method in your own settings.py file for updating values in that dictionary:

DATABASES['default']['NAME'] = '%s' % PACKAGE_NAME
DATABASES['default']['PASSWORD'] = 'your_password'

etc.

In this fashion you are directly accessing and modifying specific key/values in the DATABASES['default'] dictionary, instead of recreating the whole thing with a few new key/values.  This is especially useful in Arches, because it leaves the initial creation of that dictionary back in the original ..\site-packages\arches\settings.py file, and allows the subsequent ..\arches_hip\settings.py (plus potential ..\arches_hip\settings_local.py), and your own champ_hip\settings.py (and potential champ_hip\settings_local.py) files to sequentially add or modify specific key/value pairs, without altering the entire thing.

Hope that makes sense!

Adam

Piyush Shah

unread,
Jul 19, 2016, 12:40:45 AM7/19/16
to Adam Cox, Vincent Meijer, Arches Project
Thank You Adam and Vincent !

I had successfully install arches on windows with your guidance.

And know I have to check all things are working fine or not.

Once again thanks for helping me.

Regards, 

Vincent Meijer

unread,
Jul 20, 2016, 9:02:56 AM7/20/16
to Arches Project
Great that you got it working!

For future reference, please let us know if you can successfully run Arches and view the web pages, especially the Search and Map View pages (because these include calls to the database and elasticsearch). Also check if you can login as admin (default password = admin). 

Thanks!
Vincent
Reply all
Reply to author
Forward
0 new messages