Project

General

Profile

mysql_install_notes.txt

Notes during installation. Incl patches and workarounds (ish) up to 20180920214134 - Dan Smythe, 04/11/2019 10:13 AM

 
1
####################
2
# Setup
3
####################
4

    
5
Fresh install of CentOS 7.6
6
Install MySQL Percona Server 5.7 ( socket in /var/run/mysql/3306.sock )
7
Created symlink from /var/run/mysql/3306.sock to /var/lib/mysql/mysql.sock
8
Created foreman_production database
9
Created foreman db user ALL PRIVILEGES ON foreman_production.*
10

    
11
sudo yum -y localinstall https://fedorapeople.org/groups/katello/releases/yum/3.11/katello/el7/x86_64/katello-repos-latest.rpm
12
sudo yum -y localinstall https://yum.theforeman.org/releases/1.21/el7/x86_64/foreman-release.rpm
13
sudo yum -y localinstall https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
14
sudo yum -y localinstall https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
15
sudo yum -y install foreman-release-scl
16
sudo yum -y update
17

    
18
sudo yum -y install katello
19

    
20
####################
21
# Install
22
####################
23

    
24
[root@somehost~]# foreman-installer --scenario katello \
25
>   --enable-foreman-cli-discovery \
26
>   --enable-foreman-cli-openscap \
27
>   --enable-foreman-cli-remote-execution \
28
>   --enable-foreman-cli-tasks \
29
>   --enable-foreman-compute-ec2 \
30
>   --enable-foreman-compute-openstack \
31
>   --enable-foreman-compute-vmware \
32
>   --enable-foreman-plugin-ansible \
33
>   --enable-foreman-plugin-bootdisk \
34
>   --enable-foreman-plugin-chef \
35
>   --enable-foreman-plugin-default-hostgroup \
36
>   --enable-foreman-plugin-discovery \
37
>   --enable-foreman-plugin-hooks \
38
>   --enable-foreman-plugin-openscap \
39
>   --enable-foreman-plugin-puppetdb \
40
>   --enable-foreman-plugin-remote-execution \
41
>   --no-enable-foreman-plugin-setup \
42
>   --enable-foreman-plugin-tasks \
43
>   --no-enable-foreman-plugin-templates \
44
>   --enable-foreman-proxy \
45
>   --enable-foreman-proxy-content \
46
>   --enable-foreman-proxy-plugin-ansible \
47
>   --enable-foreman-proxy-plugin-chef \
48
>   --no-enable-foreman-proxy-plugin-dhcp-infoblox \
49
>   --enable-foreman-proxy-plugin-discovery \
50
>   --no-enable-foreman-proxy-plugin-dns-infoblox \
51
>   --enable-foreman-proxy-plugin-openscap \
52
>   --enable-foreman-proxy-plugin-pulp \
53
>   --enable-foreman-proxy-plugin-remote-execution-ssh \
54
>   --enable-katello \
55
>   --enable-puppet \
56
>   --certs-city=$MY_CITY \
57
>   --certs-group=$FOREMAN_USER \
58
>   --certs-org=$MY_COMPANY \
59
>   --certs-org-unit=$MY_DEPARTMENT' \
60
>   --certs-state=$MY_STATE \
61
>   --foreman-db-host='localhost' \
62
>   --foreman-db-adapter='mysql2' \
63
>   --foreman-db-database='foreman_production' \
64
>   --foreman-db-password=$MY_DB_PASSWORD \
65
>   --foreman-db-port=3306 \
66
>   --foreman-db-username=$MY_DB_USERNAME \
67
>   --foreman-gpgcheck=false \
68
>   --foreman-db-manage=false \
69
>   --foreman-db-type='mysql' \
70
>   --foreman-initial-admin-email=$MY_EMAIL \
71
>   --foreman-initial-admin-first-name=$MY_NAME \
72
>   --foreman-initial-admin-last-name=$MY_SURNAME \
73
>   --foreman-initial-location=$MY_DATACENTER \
74
>   --foreman-initial-organization=$MY_ORGANIZATION \
75
>   --foreman-puppetrun=true \
76
>   --foreman-plugin-tasks-automatic-cleanup=true \
77
>   --foreman-plugin-tasks-cron-line='00 00 1 * *' \
78
>   --puppet-runinterval=1800 \
79
>   --puppet-show-diff=true \
80
>   --puppet-splay=true \
81
>   --puppet-splaylimit='10m' \
82
>   --puppet-environment=$MY_PUPPET_ENVIRONMENT \
83
>   --puppet-server-metrics-graphite-enable='true' \
84
>   --puppet-server-metrics-graphite-host=$MY_GRAPHITE_ENDPOINT \
85
>   --puppet-server-metrics-graphite-interval=10 \
86
>   --puppet-server-metrics-server-id=$MY_METRIC_ID
87
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Failed to call refresh: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
88
/Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
89
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
90
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:164:in `sync'
91
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:603:in `refresh'
92
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:147:in `process_callback'
93
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:34:in `block in process_events'
94
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:119:in `block in queued_events'
95
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `each'
96
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `queued_events'
97
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:33:in `process_events'
98
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:250:in `eval_resource'
99
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
100
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
101
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
102
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
103
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
104
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
105
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
106
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
107
/usr/share/gems/gems/kafo-2.1.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
108
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
109
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
110
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
111
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
112
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
113
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
114
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
115
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
116
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
117
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
118
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
119
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
120
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
121
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
122
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:348:in `apply_catalog'
123
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
124
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
125
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
126
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
127
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
128
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
129
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
130
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
131
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
132
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
133
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
134
 /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
135
 /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: '/usr/sbin/foreman-rake db:seed' returned 1 instead of one of [0]
136
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
137
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:164:in `sync'
138
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:603:in `refresh'
139
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:147:in `process_callback'
140
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:34:in `block in process_events'
141
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:119:in `block in queued_events'
142
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `each'
143
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `queued_events'
144
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:33:in `process_events'
145
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:250:in `eval_resource'
146
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
147
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
148
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
149
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
150
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
151
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
152
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
153
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
154
/usr/share/gems/gems/kafo-2.1.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
155
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
156
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
157
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
158
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
159
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
160
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
161
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
162
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
163
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
164
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
165
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
166
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
167
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
168
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
169
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:348:in `apply_catalog'
170
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
171
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
172
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
173
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
174
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
175
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
176
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
177
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
178
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
179
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
180
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
181
Installing             Package[tfm-rubygem-foreman_ansible]               [78%] [.........................................................................................................................                                  ] Execution of '/usr/sbin/foreman-rake -- config -k 'puppetdb_dashboard_address' -v 'http://localhost:8080/pdb/dashboard'' returned 1: /usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
182
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
183
rake aborted!
184
NoMethodError: undefined method `settings_type' for nil:NilClass
185
/usr/share/foreman/lib/tasks/config.rake:105:in `block in run_key_values'
186
/usr/share/foreman/lib/tasks/config.rake:100:in `each'
187
/usr/share/foreman/lib/tasks/config.rake:100:in `run_key_values'
188
/usr/share/foreman/lib/tasks/config.rake:77:in `run'
189
/usr/share/foreman/lib/tasks/config.rake:167:in `block in <top (required)>'
190
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
191
Tasks: TOP => config
192
(See full trace by running task with --trace)
193
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/execution.rb:235:in `execute'
194
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_config_entry/cli.rb:21:in `block in run_foreman_config'
195
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_config_entry/cli.rb:10:in `chdir'
196
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_config_entry/cli.rb:10:in `run_foreman_config'
197
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_config_entry/cli.rb:35:in `run_foreman_config'
198
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_config_entry/cli.rb:78:in `value='
199
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:194:in `call_provider'
200
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:501:in `set'
201
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property.rb:561:in `sync'
202
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:236:in `sync'
203
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:134:in `sync_if_needed'
204
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:88:in `block in perform_changes'
205
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:87:in `each'
206
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:87:in `perform_changes'
207
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
208
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:233:in `apply'
209
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:249:in `eval_resource'
210
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
211
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
212
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
213
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
214
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
215
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
216
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
217
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
218
/usr/share/gems/gems/kafo-2.1.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
219
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
220
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
221
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
222
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
223
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
224
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
225
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
226
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
227
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
228
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
229
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
230
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
231
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
232
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
233
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:348:in `apply_catalog'
234
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
235
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
236
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
237
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
238
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
239
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
240
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
241
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
242
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
243
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
244
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
245
 /Stage[main]/Foreman::Plugin::Puppetdb/Foreman_config_entry[puppetdb_dashboard_address]/value: change from  to http://localhost:8080/pdb/dashboard failed: Execution of '/usr/sbin/foreman-rake -- config -k 'puppetdb_dashboard_address' -v 'http://localhost:8080/pdb/dashboard'' returned 1: /usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
246
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
247
rake aborted!
248
NoMethodError: undefined method `settings_type' for nil:NilClass
249
/usr/share/foreman/lib/tasks/config.rake:105:in `block in run_key_values'
250
/usr/share/foreman/lib/tasks/config.rake:100:in `each'
251
/usr/share/foreman/lib/tasks/config.rake:100:in `run_key_values'
252
/usr/share/foreman/lib/tasks/config.rake:77:in `run'
253
/usr/share/foreman/lib/tasks/config.rake:167:in `block in <top (required)>'
254
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
255
Tasks: TOP => config
256
(See full trace by running task with --trace)
257
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[somehost.somedomain.com]: Could not evaluate: Proxy $MY_HOSTNAME cannot be retrieved: unknown error (response 503)
258
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:7:in `proxy'
259
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:13:in `id'
260
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:17:in `exists?'
261
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/ensure.rb:81:in `retrieve'
262
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1070:in `retrieve'
263
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1098:in `retrieve_resource'
264
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:300:in `from_resource'
265
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:20:in `evaluate'
266
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:233:in `apply'
267
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:249:in `eval_resource'
268
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
269
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
270
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
271
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
272
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
273
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
274
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
275
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
276
/usr/share/gems/gems/kafo-2.1.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
277
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
278
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
279
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
280
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
281
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
282
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
283
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
284
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
285
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
286
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
287
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
288
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
289
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
290
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
291
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:348:in `apply_catalog'
292
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
293
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
294
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
295
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
296
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
297
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
298
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
299
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
300
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
301
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
302
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
303
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[$MY_HOSTNAME]: Failed to call refresh: Proxy $MY_HOSTNAME cannot be retrieved: unknown error (response 503)
304
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[$MY_HOSTNAME]: Proxy $MY_HOSTNAME cannot be retrieved: unknown error (response 503)
305
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:7:in `proxy'
306
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:13:in `id'
307
/usr/share/foreman-installer/modules/foreman/lib/puppet/provider/foreman_smartproxy/rest_v3.rb:17:in `exists?'
308
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/property/ensure.rb:81:in `retrieve'
309
/usr/share/foreman-installer/modules/foreman/lib/puppet/type/foreman_smartproxy.rb:72:in `refresh'
310
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:147:in `process_callback'
311
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:34:in `block in process_events'
312
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:119:in `block in queued_events'
313
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `each'
314
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:118:in `queued_events'
315
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/event_manager.rb:33:in `process_events'
316
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:250:in `eval_resource'
317
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `call'
318
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block (2 levels) in evaluate'
319
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
320
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
321
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
322
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:163:in `block in evaluate'
323
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
324
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:154:in `evaluate'
325
/usr/share/gems/gems/kafo-2.1.0/modules/kafo_configure/lib/puppet/parser/functions/add_progress.rb:30:in `evaluate_with_trigger'
326
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:222:in `block in apply'
327
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:155:in `with_destination'
328
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
329
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:221:in `apply'
330
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:171:in `block in apply_catalog'
331
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:224:in `block in benchmark'
332
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
333
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:223:in `benchmark'
334
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:170:in `apply_catalog'
335
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:343:in `run_internal'
336
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
337
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
338
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
339
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
340
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:348:in `apply_catalog'
341
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:274:in `block in main'
342
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
343
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
344
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:225:in `main'
345
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:170:in `run_command'
346
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
347
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
348
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
349
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
350
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
351
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
352
Installing             Done                                               [100%] [..........................................................................................................................................................]
353
  Something went wrong! Check the log for ERROR-level output
354
  The full log is at /var/log/foreman-installer/katello.log
355

    
356
foreman_production> select MAX(version) from schema_migrations;
357
+----------------+
358
| MAX(version)   |
359
+----------------+
360
| 20131014225132 |
361
+----------------+
362
1 row in set (0.00 sec)
363

    
364
Next migration: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20131016124255_add_foreign_keys_engine.rb
365

    
366
####################
367
# Error 1
368
####################
369

    
370
[root@somehost ~]# /usr/sbin/foreman-rake db:migrate
371
/usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
372
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
373
== 20131016124255 AddForeignKeysEngine: migrating =============================
374
-- add_foreign_key("katello_activation_keys", "katello_content_views", {:column=>"content_view_id", :name=>"activation_keys_content_view_id_fk"})
375
rake aborted!
376
StandardError: An error has occurred, all later migrations canceled:
377

    
378
Mysql2::Error: Can't write; duplicate key in table '#sql-2f8d_275': ALTER TABLE `katello_activation_keys` ADD CONSTRAINT `activation_keys_content_view_id_fk`
379
FOREIGN KEY (`content_view_id`)
380
  REFERENCES `katello_content_views` (`id`)
381

    
382
Everything was applied except the last 2 FK's
383
    add_foreign_key "katello_user_notices", "katello_notices", :name => "user_notices_notice_id_fk", :column => 'notice_id'
384
    add_foreign_key "katello_user_notices", "users", :name => "user_notices_user_id_fk", :column => 'user_id'
385

    
386
I applied them manually:
387
ALTER TABLE katello_user_notices ADD FOREIGN KEY `user_notices_notice_id_fk` (`notice_id`) REFERENCES `katello_notices` (`id`);
388
ALTER TABLE katello_user_notices ADD FOREIGN KEY `user_notices_user_id_fk` (`user_id`) REFERENCES `users` (`id`);
389

    
390
And inserted the migration record:
391
foreman_production> INSERT INTO schema_migrations VALUES ( 20131016124255 );
392

    
393
And re-ran db:migrate
394

    
395
####################
396
# Error 2
397
####################
398

    
399
Mysql2::Error: Specified key was too long; max key length is 3072 bytes: CREATE  INDEX `katello_rpms_fields_index`  ON `katello_rpms` (`id`, `uuid`, `name`, `version`, `release`, `arch`, `version_sortable`, `release_sortable`)
400
In /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20150613134559_add_rpm.rb:20:in `up'
401

    
402

    
403
Commented Line 20:
404
 20 #    add_index :katello_rpms, [:id, :uuid, :name, :version, :release, :arch, :version_sortable, :release_sortable], :name => 'katello_rpms_fields_index'
405
--- /home/$MY_USERNAME/20150613134559_add_rpm.rb.orig	2019-04-11 00:17:51.613312959 -0700
406
+++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20150613134559_add_rpm.rb	2019-04-11 00:18:21.630862198 -0700
407
@@ -17,7 +17,7 @@
408
     end
409

    
410
     add_index :katello_rpms, :uuid, :unique => true
411
-    add_index :katello_rpms, [:id, :uuid, :name, :version, :release, :arch, :version_sortable, :release_sortable], :name => 'katello_rpms_fields_index'
412
+#    add_index :katello_rpms, [:id, :uuid, :name, :version, :release, :arch, :version_sortable, :release_sortable], :name => 'katello_rpms_fields_index'
413

    
414
     create_table "katello_repository_rpms" do |t|
415
       t.references :rpm, :null => false
416

    
417
Dropped katello_rpms
418
Reran db:migrate
419
( MUST ADD INDEX LATER )
420

    
421

    
422
####################
423
# Error 3
424
####################
425

    
426
Next up:
427
Mysql2::Error: Cannot drop index 'index_katello_subscription_facets_on_user_id': needed in a foreign key constraint: DROP INDEX `index_katello_subscription_facets_on_user_id` ON
428
`katello_subscription_facets`
429
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20161028153131_sub_facet_user_index_not_uniq.rb
430

    
431
foreman_production> ALTER TABLE katello_subscription_facets DROP FOREIGN KEY `fk_rails_ee1659f1ac`;
432
foreman_production> ALTER TABLE katello_subscription_facets DROP KEY `index_katello_subscription_facets_on_user_id`;
433
foreman_production> ALTER TABLE katello_subscription_facets ADD KEY `index_katello_subscription_facets_on_user_id` (`user_id`);
434
foreman_production> ALTER TABLE katello_subscription_facets ADD FOREIGN KEY `fk_rails_ee1659f1ac`(`user_id`) REFERENCES `users`(`id`);
435
foreman_production> INSERT INTO schema_migrations VALUES ( 20161028153131 );
436

    
437

    
438
####################
439
# Error 4
440
####################
441

    
442
Next up:
443
-- change_column(:katello_pools, :start_date, "timestamp USING CAST(start_date AS timestamp without time zone)", {})
444
rake aborted!
445
SystemStackError: stack level too deep
446
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/concurrent-ruby-1.1.4/lib/concurrent/map.rb:192:in `fetch_or_store'
447
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/type/type_map.rb:20:in `fetch'
448
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/type/type_map.rb:16:in `lookup'
449
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/type/type_map.rb:39:in `block in alias_type'
450

    
451
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20170222131211_change_pool_columns_to_dates.rb
452

    
453
# Guessing here....
454

    
455
foreman_production> ALTER TABLE katello_pools MODIFY start_date TIMESTAMP, MODIFY end_date TIMESTAMP;
456
Query OK, 0 rows affected (0.02 sec)
457
Records: 0  Duplicates: 0  Warnings: 0
458

    
459

    
460
####################
461
# Error 5
462
####################
463

    
464
Next up:
465
Mysql2::Error: Specified key was too long; max key length is 3072 bytes: CREATE  INDEX `katello_debs_fields_index`  ON `katello_debs` (`id`, `uuid`, `name`, `version`, `architecture`, `version_sortable`)
466
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20170714144125_add_deb.rb:16:in `up'
467

    
468
Commented line 16
469
#    add_index :katello_debs, [:id, :uuid, :name, :version, :architecture, :version_sortable], :name => 'katello_debs_fields_index'
470

    
471
DROP TABLE katello_debs;
472

    
473
Rerun migrate
474

    
475

    
476
####################
477
# Error 6
478
####################
479

    
480
Next up:
481
-- add_index(:katello_srpms, [:id, :uuid, :name, :version, :release, :arch, :version_sortable, :release_sortable], {:name=>"katello_srpms_fields_index"})
482
rake aborted!
483
StandardError: An error has occurred, all later migrations canceled:
484

    
485
Mysql2::Error: Specified key was too long; max key length is 3072 bytes: CREATE  INDEX `katello_srpms_fields_index`  ON `katello_srpms` (`id`, `uuid`, `name`, `version`, `release`, `arch`, `version_sortable`, `release_sortable`)
486

    
487
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20171011175510_add_srpm.rb
488

    
489
Comment line 20:
490
#    add_index :katello_srpms, [:id, :uuid, :name, :version, :release, :arch, :version_sortable, :release_sortable], :name => 'katello_srpms_fields_index'
491

    
492
DROP TABLE katello_srpms
493

    
494

    
495
####################
496
# Error 7
497
####################
498

    
499
Next up:
500
-- add_foreign_key("katello_subscription_facet_installed_products", "katello_subscription_facets", {:name=>"katello_sub_facet_installed_product_facet_id", :column=>"subscription_facet_id"})
501
rake aborted!
502
StandardError: An error has occurred, all later migrations canceled:
503

    
504
Column `subscription_facet_id` on table `katello_subscription_facet_installed_products` has a type of `bigint(20)`.
505
	This does not match column `id` on `katello_subscription_facets`, which has type `int(11)`.
506
To resolve this issue, change the type of the `subscription_facet_id` column on `katello_subscription_facet_installed_products` to be :integer. (For example `t.integer subscription_facet_id`).
507

    
508
Original message: Mysql2::Error: Cannot add foreign key constraint: ALTER TABLE `katello_subscription_facet_installed_products` ADD CONSTRAINT `katello_sub_facet_installed_product_facet_id`
509
FOREIGN KEY (`subscription_facet_id`)
510
  REFERENCES `katello_subscription_facets` (`id`)
511

    
512

    
513
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20180117202932_sub_facet_add_installed_products.rb
514

    
515

    
516
ALTER TABLE foreman_production.katello_subscription_facet_pools DROP FOREIGN KEY katello_sub_facet_pools_sf_id_fk;
517
ALTER TABLE foreman_production.katello_subscription_facet_activation_keys DROP FOREIGN KEY katello_subscription_facet_activation_keys_sa_id;
518

    
519
ALTER TABLE katello_subscription_facets MODIFY id BIGINT NOT NULL AUTO_INCREMENT;
520
ALTER TABLE katello_subscription_facet_activation_keys MODIFY subscription_facet_id BIGINT NOT NULL;
521
ALTER TABLE katello_subscription_facet_activation_keys ADD CONSTRAINT `katello_subscription_facet_activation_keys_sa_id` FOREIGN KEY ( `subscription_facet_id` ) REFERENCES `katello_subscription_facets`(`id`);
522

    
523
ALTER TABLE katello_subscription_facet_pools MODIFY subscription_facet_id BIGINT DEFAULT NULL;
524

    
525
ALTER TABLE katello_subscription_facet_pools ADD CONSTRAINT `katello_sub_facet_pools_sf_id_fk` FOREIGN KEY (`subscription_facet_id`) REFERENCES `katello_subscription_facets` (`id`);
526

    
527
# Doing this one because it's the last thing in the migration script.
528
ALTER TABLE katello_subscription_facet_installed_products ADD CONSTRAINT `katello_sub_facet_installed_product_product_id` FOREIGN KEY (`installed_product_id`) REFERENCES `katello_installed_products` (`id`);
529

    
530
INSERT INTO schema_migrations VALUES (20180117202932);
531

    
532

    
533
####################
534
# Error 8
535
####################
536

    
537
Next up:
538
Column `pool_id` on table `katello_pool_products` has a type of `bigint(20)`.
539
This does not match column `id` on `katello_pools`, which has type `int(11)`.
540
To resolve this issue, change the type of the `pool_id` column on `katello_pool_products` to be :integer. (For example `t.integer pool_id`).
541

    
542
Original message: Mysql2::Error: Cannot add foreign key constraint: ALTER TABLE `katello_pool_products` ADD CONSTRAINT `katello_pool_products_pool_id_fk`
543
FOREIGN KEY (`pool_id`)
544
  REFERENCES `katello_pools` (`id`)
545

    
546
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20180326190408_move_subscription_products.rb
547

    
548
--- /home/$MY_USERNAME/20180326190408_move_subscription_products.rb.orig	2019-04-11 01:10:20.711589703 -0700
549
+++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20180326190408_move_subscription_products.rb	2019-04-11 01:17:30.882656548 -0700
550
@@ -23,10 +23,12 @@
551

    
552
   def up
553
     create_table "katello_pool_products" do |t|
554
-      t.references :pool
555
-      t.references :product
556
+      t.integer :pool_id
557
+	  t.integer :product_id
558
       t.timestamps
559
     end
560
+	add_index "katello_pool_products", :pool_id
561
+	add_index "katello_pool_products", :product_id
562
     add_index "katello_pool_products", [:pool_id, :product_id], :unique => true,
563
               :name => "index_katello_pool_products_on_subs_id_prod_id"
564

    
565
DROP TABLE katello_pool_products
566
Rerun migrate.
567

    
568

    
569
####################
570
# Error 9
571
####################
572

    
573
Next Up:
574

    
575
Mysql2::Error: Specified key was too long; max key length is 3072 bytes: ALTER TABLE `tokens` CHANGE `value` `value` varchar(900) DEFAULT NULL
576
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `_query'
577

    
578

    
579
In: /usr/share/foreman/db/migrate/20180613100703_add_type_to_token.rb
580
Was only a warning, but mysql reduced the key to 768
581

    
582

    
583
####################
584
# Error 10
585
####################
586

    
587
Next:
588
StandardError: An error has occurred, all later migrations canceled:
589

    
590
Column `repository_id` on table `katello_repository_module_streams` has a type of `bigint(20)`.
591
This does not match column `id` on `katello_repositories`, which has type `int(11)`.
592
To resolve this issue, change the type of the `repository_id` column on `katello_repository_module_streams` to be :integer. (For example `t.integer repository_id`).
593

    
594
Original message: Mysql2::Error: Cannot add foreign key constraint: ALTER TABLE `katello_repository_module_streams` ADD CONSTRAINT `katello_repo_mod_stream_repo_id_fk`
595
FOREIGN KEY (`repository_id`)
596
  REFERENCES `katello_repositories` (`id`)
597

    
598

    
599
In: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20180807145652_create_katello_module_streams.rb
600

    
601
SKIPPED IT ( inserted record into schema_migrations )
602

    
603

    
604
####################
605
# Error 11
606
####################
607

    
608
Next:
609

    
610
Column `root_id` on table `katello_repositories` has a type of `int(11)`.
611
This does not match column `id` on `katello_root_repositories`, which has type `bigint(20)`.
612
To resolve this issue, change the type of the `root_id` column on `katello_repositories` to be :integer. (For example `t.integer root_id`).
613

    
614
Original message: Mysql2::Error: Cannot add foreign key constraint: ALTER TABLE `katello_repositories` ADD CONSTRAINT `katello_root_repositories_repo_id`
615
FOREIGN KEY (`root_id`)
616
  REFERENCES `katello_root_repositories` (`id`)
617
/opt/theforeman/tfm/root/usr/share/gems/gems/mysql2-0.4.5/lib/mysql2/client.rb:120:in `_query'
618

    
619

    
620
In /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/db/migrate/20180920214134_create_repository_root.rb
621

    
622

    
623
I give up. I'm in 2018 and this one is just a beast to try to fix, especially because it's aborted itself in the middle so I'd either have to manually roll forward or back, yuck.
624

    
625
https://bpaste.net/show/7aa2233ca5ae