132 views
Skip to first unread message

Denis

unread,
Feb 3, 2016, 9:17:04 AM2/3/16
to django...@googlegroups.com
Hi,

I'm looking at upgrading my application from 1.6 to 1.9.2... An issue I'm encountering now is that on Heroku, running collectstatic doesn't work on 1.9.2. The odd  things is that if I try 1.8.7 instead, it work great...


Running:
remote: python manage.py collectstatic -i docs -i tests --noinput -v 3
remote: Copying '/app/accounts/static/...js'
remote: Copying '/app/accounts/static/....js'
remote: Copying '/app/accounts/static/....js'
... [ Thousands of lines... ]
remote: Found another file with the destination path 'app/controllers/...js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote: Found another file with the destination path 'app/controllers/....js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote: Traceback (most recent call last):
remote:             output = self.handle(*args, **options)
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 176, in handle
remote:     collected = self.collect()
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
remote:     level=1,
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 201, in log
remote:     self.stdout.write(msg)
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 111, in write
remote:     self._out.write(force_str(style_func(msg)))
remote: IOError: [Errno 11] Resource temporarily unavailable


I do have a lot of static file... Unsure that matter.

An other things is that it doesn't seem to fail at the same point in the collectstatic command every time I run it. So look like it's failing on different file every time I run it...


But I actually don't use django-require... (It's not in my requirement.txt of what I install on Heroku)


I also see it fail (sometime but much less often as the "Resource temporarily unavaible" error this way:
remote: Found another file with the destination path 'accounts/..html'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote: Found another file with the destination path 'accounts/...js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote: Traceback (most recent call last):
remote:   File "manage.py", line 10, in <module>
remote:     execute_from_command_line(sys.argv)
remote:     utility.execute()
remote:         self.execute(*args, **cmd_options)

Which is even less helpful in figuring out what's going on...


So I'm looking for some though on what this error mean and how to debug it further. We never encountered that error when on 1.6. Testing on 1.8.7 works fine but then if I only change the Django version (nothing else) to 1.9.2, I start getting that error...


Thanks everyone!

Denis Bellavance
Peach
Seattle

Sergiy Khohlov

unread,
Feb 3, 2016, 9:34:47 AM2/3/16
to django-users
 Hello Denis,

 This issue  is not related  to the  django-require.  Look like you have two  files (with  same name ) at the different paths. New  collect static is trying to colelct both files and can not decided  which one should be used. 
Could you please  send part of the section  STATICFILES_DIRS and INSTALLED_APP ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOdjZ6K7j9Xv70%2BRYSBEdFom-VWRLMMy_e2CRZzfqmngA1ZBrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Denis Bellavance

unread,
Feb 4, 2016, 1:36:01 AM2/4/16
to Django users
Hi,

The "remote: Found another file with the destination path" is not actually an error, I actually have thousands of those and it is normal. It's simply suppose to be a warning that was added in version 1.9:
"Added warning to collectstatic when static files have clashing names"

It should not make the code crash... but somehow maybe the logger become unavailable and it is why I get exception "Resource temporarily unavailable" ?

I will try turning down verbosity (so shouldn't be logging this anymore), and see if it help... (verbosity=0)

Denis Bellavance

unread,
Feb 4, 2016, 1:57:38 AM2/4/16
to Django users
Allright,

Deploying with verbosity=0 solved my problem.

Something is happening in that  self.log(  call at line 112 that make it crash on Heroku. Unsure what it is and unsure the issue is on Django side.

At least this resolves my problem and there is some reference if someone else encounter this issue on Heroku too...

Thanks

Sergiy Khohlov

unread,
Feb 4, 2016, 3:45:45 AM2/4/16
to django-users
hard to help without settings.py 


Many thanks,

Serge


+380 636150445
skype: skhohlov

James Schneider

unread,
Feb 4, 2016, 4:43:13 AM2/4/16
to django...@googlegroups.com

>> Deploying with verbosity=0 solved my problem.
>>

Workaround is probably a better term than solved. ;-)

>> Something is happening in that  self.log(  call at line 112 that make it crash on Heroku. Unsure what it is and unsure the issue is on Django side.
>>

Providing the code (and reasonable context from surrounding statements) around line 112 would be a big help if you want to troubleshoot further. Logging settings would be helpful as well.

>> At least this resolves my problem and there is some reference if someone else encounter this issue on Heroku too...
>>

Do you encounter this issue on your local dev machine, or are you publishing/developing directly on Heroku?

Is it possible that you are hitting some sort of upper limit in your Heroku instance such as memory usage, logging rate, or file creation rate? Perhaps you are bursting past the standard resource allocations and the system is denying requested resources to your Django process (since you mentioned thousands of lines in your output)?

Does Heroku have any sort of OS level logging for the container where your instance is running? That may provide some clues as to why your script seems to be failing at random points in the file creation process.

-James

Mads Viborg Jørgensen

unread,
Apr 15, 2016, 10:28:11 AM4/15/16
to Django users
I'm kind of stuck on the same thing here. And I'm interested in a solution as I beleive it is causing me some troubles.
My relevant settings.py are:
STATICFILES_DIRS = (
    os.path.join(PROJECT_ROOT, 'static'),
)

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    # 'whitenoise.runserver_nostatic',
    'django.contrib.staticfiles',
    # Resently added
    'haystack',
    'whoosh',
    # our app(s)
    'hello',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
    #'whitenoise.middleware.WhiteNoiseMiddleware',
)
Reply all
Reply to author
Forward
0 new messages