Python "setuptools" change failing build

google-app-engine
python

#1

It looks like there was a change either on Circle CI’s end or from someone upstream, but I’ve started seeing build failures while trying to deploy. I’m trying to deploy to Google App Engine and it doesn’t accept files with special characters. I’ve patched it to skip the file in question, but probably something to watch out for if it was upstream.

I get the failure:

ERROR: (gcloud.preview.app.deploy) Error Response: [400] Invalid character in filename: venv/lib/python2.7/site-packages/setuptools/script template (dev).py

It seems to be coming from an included python library in the virtual environments by default when building.


#2

Pretty sure it’s the space in the filename, but not sure where that comes from as I can’t seem to find this file in setuptool’s bitbucket.

Here’s what a search turns up, if it helps in narrowing it down.


#3

Agree with @drazisil, looks like the space is not something gcloud expects in a deployment. Could you please check if you can deploy from your local machine with the exact same command and file set that you are using on CircleCI?


#4

So the build and deploy succeeded on CircleCI 6 days ago. However a rebuild of the exact same changelist today does not. I don’t use virtualenv locally. All the python dependencies we install as a part of our process do not install do venv. They are instead installed to a specific folder in our project (./lib) and they are locked at specific versions in pip.

If I exclude the venv file from the deploy, it deploys without issue. If I login to the build machines before anything else has run (i.e. my install scripts), the venv folder still includes the file in question so it appears to be coming from the native python build installed on the machine. I also tried building without the cache and had the same results. Along with the setuptools folder, there are also folders for nose, pip, and easyinstall (which I would mostly expect from a python virtualenv directory). The setuptools is the only folder with issues.


#5

Got it, thank you very much for the details.

Could you please try just deleting the venv directory in the project folder before proceeding to the gcloud deployment? Something like this should do:

deployment:
  production:
    branch: master
    commands:
      - rm -rf venv/
      - gcloud …

Would be great to see if that helps.


#6

While I don’t delete the venv folder before deployment, I have added it to the list of excluded folders. The venv folder no longer is part of my deployment and the deployment succeeds fine now.

Truthfully I should have been excluding it all along, but I hadn’t ever added it to the exclusion list. Mostly it was just that I was helping another person setup a fork of the project with CircleCI and it was breaking for them when mine had succeeded. But we got it resolved with skipping things so the main point here is an FYI for you all at Circle and a reference in case someone else hits the issue :slight_smile:


#7