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

iocage upgrade is looping: src component not installed, skipped #399

Closed
dlangille opened this issue Oct 23, 2017 · 15 comments

Comments

@dlangille
Copy link
Contributor

commented Oct 23, 2017

# iocage --version
Version	0.9.9.2 09/30/2017

Just upgraded from non-python version. Host is on FreeBSD 11.1 and want to upgrade the jails from 10.3 to 11.1

Issued this command: iocage upgrade clavin2 -r 11.1-RELEASE

....

...
/var/db/etcupdate/log
/var/db/mergemaster.mtree
/var/yp/Makefile.dist
To install the downloaded upgrades, run "/tmp/tmpsbh3q0up install".
src component not installed, skipped
Installing updates...
Kernel updates have been installed.  Please reboot and run
"/tmp/tmpsbh3q0up install" again to finish installing updates.
src component not installed, skipped
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/tmp/tmpsbh3q0up install"
again to finish installing updates.
src component not installed, skipped
Installing updates... done.
src component not installed, skipped
No updates are available to install.
Run '/tmp/tmpsbh3q0up fetch' first.
src component not installed, skipped
No updates are available to install.
Run '/tmp/tmpsbh3q0up fetch' first.
src component not installed, skipped
...

It is now looping on that command

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 23, 2017

This was from an upstream change on freebsd. I just recently closed a duplicate of this, will be in the next release or you can grab head

#397

@skarekrow skarekrow added the duplicate label Oct 23, 2017

@skarekrow skarekrow closed this Oct 23, 2017

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 23, 2017

After building head:

iocage --version
Version 0.9.10 ALPHA


[root@tallboy:~] # iocage upgrade clavin2 -r 11.1-RELEASE
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 10.3-RELEASE from update6.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
world/base world/doc world/games world/lib32

The following components of FreeBSD do not seem to be installed:
src/src


Fetching metadata signature for 11.1-RELEASE from update6.freebsd.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 10.3-RELEASE for merging... done.
Preparing to download files... done.
/tmp/tmpynye6dv9: cannot open files/.gz: No such file or directory
/tmp/tmpynye6dv9: cannot open files/.gz: No such file or directory
...
/tmp/tmpynye6dv9: cannot open files/.gz: No such file or directory
Attempting to automatically merge changes in files... done.

The following file could not be merged automatically: /etc/mail/mailer.conf
Press Enter to edit this file in joe and resolve the conflicts
manually...

The usual files were manually updated.

Then it started wanted to remove files:

File /iocage/jails/clavin2/root/var/db/freebsd-update/merge/new//etc/ssh/ssh_config saved

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /boot/device.hints
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/amd.map
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/apmd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/auto_master
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/autofs/include_ldap
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/autofs/special_hosts
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/autofs/special_media
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/autofs/special_noauto
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/autofs/special_null
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/blacklistd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/bluetooth/hcsecd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.1-RELEASE: /etc/bluetooth/hosts
Does this look reasonable (y/n)? ^C
Aborted!

I am rather sure those files should not be removed.

I figured the previous upgrade attempt failed, the next attempt via HEAD got confused, or something.

I have since rolled back that jail to the snapshots I had:

  501  zfs rollback system/iocage/jails/clavin2@BeforeUpgradingIOCAGE
  502  zfs rollback system/iocage/jails/clavin2/data@BeforeUpgradingIOCAGE
  503  zfs rollback system/iocage/jails/clavin2/root@BeforeUpgradingIOCAGE

Now when I attempt to upgrade:

[root@tallboy:~] # zfsiocage upgrade clavin2 -r 11.1-RELEASE
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 204, in json_load
    with open(self.location + "/config.json", "r") as conf:
FileNotFoundError: [Errno 2] No such file or directory: '/iocage/jails/clavin2/config.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage/cli/upgrade.py", line 88, in cli
    conf = ioc_json.IOCJson(path).json_load()
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_json.py", line 301, in json_load
    self.json_convert_from_zfs(uuid, skip=skip)
UnboundLocalError: local variable 'uuid' referenced before assignment

Recall, I had just upgraded from iocage-1.7.6

I suspect iocage HEAD thinks this jail is modern, but it is not.

What do you think?

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 23, 2017

Indeed it looks like it’s trying to find the config.json for that jail. As for the file removal, I’m perplexed. I’ve seen this only 2 times and I haven’t been able to replicate it.

If you are able to I would greatly appreciate it, as of now I’m not sure where we need to fix things. Perhaps Colin would have an idea, as it may be freebsd-update related.

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 23, 2017

Looking at the other jails, each config.json file was created at about 15:13 UTC.

I have no doubt that it disappeared because of, and only because of, my zfs rollback.

i.e. it did not disappear because of freebsd-update

How can I create that file?

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 23, 2017

I have taken the file from one of the other jails, and created something close. I grabbed the value for jail_zfs_dataset from a prior 'iocage list' output.

The ip4_addr values I adjusted based on DNS entries.

What I don't know is the proper value for hostid

EDIT: It looks like hostid relates to the jail host and is the same for all jails on this box.

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 23, 2017

Correct. hostid is per host. iocage should be creating that file if it’s missing on each invocation.

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 23, 2017

Why might it not be creating? It's just failing instead. Is there a setting which say: this file exists, go get it. Say, something that says this is a python iocage jail?

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 23, 2017

But it's not... I don't know why.

I have upgraded that jail now, and two others.

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

Ok good. I think you ran into #373, so you reverted, tried upgrading again and besides the JSON configuration, it all worked? It didn't try to remove files?

Do you happen to have any idea what might have changed since that snapshot and your attempt with the original upgrade that wanted to nuke those files?

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 24, 2017

This may help:

  • snapshot taken
  • iocage python installed
  • jails upgraded - I suspect this created the config.json files
  • failed upgrades
  • rollback applied on one jail

That jail lost the config.json, none of the others did.

It lost it because the snapshot was taken before it was created.

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

Any invocation of the python iocage would create the JSON, so I'm going to assume that is the correct bug that hit you. I do believe I recreated the upgrade issue as well, I'll ping back if I push a commit that fixes it 👍

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 24, 2017

I was hoping for magic of JSON creation, but it did not love me.

Instead, I created it based on the other examples.

Thank you.

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

Hehe yes. There are only a few unique properties to the actual JSON, so you should be good to go.

You're welcome!

@skarekrow

This comment has been minimized.

Copy link
Member

commented Oct 24, 2017

@dlangille 2562ce2 should fix this problem for you in the future :)

@dlangille

This comment has been minimized.

Copy link
Contributor Author

commented Oct 24, 2017

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.