Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt-cache throws error when running with --no-generate #22

Closed
beata opened this issue Jan 6, 2017 · 3 comments
Closed

apt-cache throws error when running with --no-generate #22

beata opened this issue Jan 6, 2017 · 3 comments

Comments

@beata
Copy link

beata commented Jan 6, 2017

OS: ubuntu:trusty

Ansible log

TASK [debops.php : Get available PHP packages for selected version] ************
[DEPRECATION WARNING]: always_run is deprecated. Use check_mode = no instead..
This feature will be removed in version 2.4. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
fatal: [gwectest_web]: FAILED! => {"changed": false, "failed": true, "rc": 100, "stderr": "E: Could not open file  - open (2: No such file
or directory)\nE: Unable to determine file size for fd -1 - fstat (9: Bad file descriptor)\nE: Can't mmap an empty file\nE: Empty package c
ache\nE: Could not open file  - open (2: No such file or directory)\nE: Unable to determine file size for fd -1 - fstat (9: Bad file descri
ptor)\nE: Can't mmap an empty file\nE: Empty package cache\n", "stdout": "", "stdout_lines": []}

Test by executing command directly:

# With `--no-generate` => fail
root@d8d60c0bb48a:/# apt-cache pkgnames php --no-generate
E: Could not open file  - open (2: No such file or directory)
E: Unable to determine file size for fd -1 - fstat (9: Bad file descriptor)
E: Can't mmap an empty file
E: Empty package cache

# Without `--no-generate` => success
root@d8d60c0bb48a:/# apt-cache pkgnames php-memcache
php-memcached
php-memcache
@carlalexander
Copy link
Contributor

I'm getting a whole bunch of errors when I take it out. Example:

Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:9

@carlalexander
Copy link
Contributor

It looks like I made a typo editing the script. I think there's no fatal errors!

@beata beata changed the title apt-cache throws error when running with --no-generate apt-cache throws error when running apt-get with --no-generate Jan 9, 2017
@beata beata changed the title apt-cache throws error when running apt-get with --no-generate apt-cache throws error when running with --no-generate Jan 9, 2017
@beata beata changed the title apt-cache throws error when running with --no-generate apt-cache throws error when running with --no-generate Jan 9, 2017
@drybjed
Copy link
Member

drybjed commented Jan 9, 2017

Thanks, it looks like at certain points the APT cache might be not ready for use and initialization might be needed. I'll drop the --no-generate from the script to fix this.

drybjed added a commit to drybjed/ansible-php that referenced this issue Feb 21, 2017
@drybjed drybjed closed this as completed Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants