pkg install errors in jail

Status
Not open for further replies.

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
I'm running FreeNAS-9.3-STABLE-201506292130. I was attempting to update packages in the jail and then try to figure out why the mysqldump command was not found and install any missing packages to obtain it.

typing: "portsnap update" or "portsnap fetch" yields
portsnap: not found

pkg update yields
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local

Trying to use setenv to set the location of PACKAGESITE also fails with setenv: not found.

Now on to my questions:
- How can I resolve this? While deleting the jail and recreating it might be the easy answer, I don't really see it as an option since I have hours of time spent setting up PHP, MySQL, Apache, etc.
- All of my customizations have been in the jail, is it possible that running the FreeNAS updates have caused problems?
- any reason why "pkg autoremove" would remove dependencies that are actually needed and cause this problem?
 
D

dlavigne

Guest
Hmm, that sounds pretty borked... AFAIK, the update should not have touched the jail at all.

- any reason why "pkg autoremove" would remove dependencies that are actually needed and cause this problem?

What exactly did you autoremove?
 

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
Hmm, that sounds pretty borked... AFAIK, the update should not have touched the jail at all.
What exactly did you autoremove?

Hehe, yeah that's an understatement. The autoremove is ultimately unrelated because I ran it after pkg failed to update. Unfortunately I performed a well executed bonehead move and didn't carefully scan what was being removed because I assumed that when it said it would only remove unneeded dependencies, that it would actually do just that.

When I run pkg check -d -a to look for missing dependencies, here is what I get:
Checking all packages: 88%net/samba41 has a missing dependency: lang/gcc
Checking all packages: 100%

>>> Missing package dependencies were detected.
>>> Found 1 issue(s) in the package database.

The following packages will be installed:

New packages to be INSTALLED:
gcc: 4.8.3_1
mpfr: 3.1.2_2
mpc: 1.0.2_1
gcc-ecj: 4.5
binutils: 2.24_1

The process will require 386 MB more space.
73 MB to be downloaded.

>>> Try to fix the missing dependencies? [y/N]: y
Checking integrity... done (0 conflicting)
pkg: archive_read_open_filename(/usr/ports/packages/All/mpfr-3.1.2_2.txz): Failed to open '/usr/ports/packages/All/mpfr-3.1.2_2.txz'
>>> Summary of actions performed:

lang/gcc dependency failed to be fixed

>>> There are still missing dependencies.
>>> You are advised to try fixing them manually.

>>> Also make sure to check 'pkg updating' for known issues.

Ideas?
 
D

dlavigne

Guest
While pkg is improving, it still has its moments.

Does pkg install -f mpfr fix that issue?
 

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
unfortunately no

localhost# pkg install -f mpfr
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
pkg: repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/digests.txz: No such file or directory
pkg: Unable to update repository local
All repositories are up-to-date.
The following 5 packages will be affected (of 0 checked):

New packages to be INSTALLED:
mpfr: 3.1.2_2
gcc: 4.8.3_1
mpc: 1.0.2_1
gcc-ecj: 4.5
binutils: 2.24_1

The process will require 386 MB more space.
73 MB to be downloaded.

Proceed with this action? [y/N]: y
Checking integrity... done (0 conflicting)
pkg: archive_read_open_filename(/usr/ports/packages/All/mpfr-3.1.2_2.txz): Failed to open '/usr/ports/packages/All/mpfr-3.1.2_2.txz'
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
1. dump database to backup storage
2. install new jail
3. restore database
 

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
@pirateghost I appreciate the simple solution, but it's not so simple. I have many hours invested in installing these packages. A new jail will require that I do all that again. I understand that my data is not lost and that's good, but deleting the jail and recreating it, while fixing the problem doesn't identify what caused it in the first place so it doesn't happen again.

Is it possible that updating the packages using pkg update could cause this problem? If ultimately I need to delete the jail and recreate it then ok, but not knowing what caused it is disconcerting because it will only happen again.
 
Last edited:

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
Does anyone know if it's possible to manually download these txz files? Perhaps these missing dependencies can be restored... I just don't know how.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You should ask on the freebsd mailing list. You will get much better information there.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Have you tried to restore the package database?

I know you don't want to start over but it does sound like things are really screwed up and your best bet at this point is likely to start over fresh.

I do have one question though. If this installation is so important and took so long to install and configure then why don't you have your configuration files backed up so they can be easily restored? That might be something you should explore once you get things up and running again.
 

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
Thanks Jailer, yes I agree. I am new to setting up xAMP servers which explains why I'm missing some of these things. I'm learning as I go with lots of reading. When you talk about the configuration files, do you mean the various .conf files that have to do with the packages I'm installing or other configuration files?

I looked at the URL you sent. Any idea where pkg would be keeping the backups in freenas jail installations?

I'm thinking in the future that if it's possible to create a mirror image of a jail I'll do that before making any changes in the future. Any tips on that or do I need to manually backup everything that way?
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Thanks Jailer, yes I agree. I am new to setting up xAMP servers which explains why I'm missing some of these things. I'm learning as I go with lots of reading. When you talk about the configuration files, do you mean the various .conf files that have to do with the packages I'm installing or other configuration files?

I looked at the URL you sent. Any idea where pkg would be keeping the backups in freenas jail installations?

I'm thinking in the future that if it's possible to create a mirror image of a jail I'll do that before making any changes in the future. Any tips on that or do I need to manually backup everything that way?
Snapshots man. Snapshots
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Thanks Jailer, yes I agree. I am new to setting up xAMP servers which explains why I'm missing some of these things. I'm learning as I go with lots of reading. When you talk about the configuration files, do you mean the various .conf files that have to do with the packages I'm installing or other configuration files?

I looked at the URL you sent. Any idea where pkg would be keeping the backups in freenas jail installations?

I'm thinking in the future that if it's possible to create a mirror image of a jail I'll do that before making any changes in the future. Any tips on that or do I need to manually backup everything that way?

No I don't know the default location of the package backup and I'm not near my server to check. Maybe someone more familiar with this can chime in and help.

The configuration files I'm referring to are the php, apache and mysql (or whatever database you are using) files. Any configuration file you modified you should have a backup of in case you need to reinstall from scratch. It makes things much easier if things go sideways as they are now. Also as pirateghost has suggested snapshots are a good way to get you out of trouble if you get stuck like this as well.

I've got a jail setup with a femp stack running a very small private discussion forum. I've got hourly snapshots of the jails set up and a daily rsync task to backup all the forum and database files for disaster recovery if needed. These files are also synced off site to a google drive account. In addition to that I have a manual backup of my php and nginx configuration files as well as the ssl certs in case I have to do a fresh install. I also have an additional jail that is a mirror of the live jail that I do all testing on before applying anything to the live site so yes I would suggest setting one up if your main jail setup is that valuable to you.

ETA: I don't know what you plan on doing with your AMP stack install but if it's going to be anything internet facing make sure you research thoroughly on hardening your server and best practices before exposing it to the wild.
 
Last edited:

objecttothis

Explorer
Joined
Feb 24, 2015
Messages
58
Yeah, I've already run a Lynis audit and was working on those. Since it's a specific application I'm considering setting up the firewall to only respond to a whitelist of mac addresses which would significantly help. My AMP stack does not seem to be having issues... at least in the sense that the web applications are running and the database is working fine. Nonetheless, I will probably redo the Jail and reinstall everything with snapshots
 
Status
Not open for further replies.
Top