Fix nil exception when Slack integration is enabled at instance level

Summary

After introducing changes for Slack integration in MR !200657 (merged), a regression was identified where enabling Slack integration at the instance level causes a nil exception due to missing parent record handling.

Problem Statement

When Slack integration is enabled at the instance level, the integration does not have a parent record available. This causes a NoMethodError exception when attempting to access parent.full_path on a nil parent object.

The problematic code:

new_slack_integration.alias = new_integration.parent.full_path

Steps to reproduce

Project

  1. Click New Project
  2. Select Create blank project
  3. Name the project
  4. Select the group (any group)
  5. Private visibility
  6. Uncheck Initialize repository with a README
  7. Click Create project and the error occurs

Group

  1. Click New Group
  2. Select Create group
  3. Give the group a name
  4. Private
  5. Who will be using this group? My company or team
  6. Click Create group
  7. 500: We're sorry, something went wrong on our end

What is the current bug behavior?

After upgrade, creating a new project gives the error:

The form contains the following error:
undefined method `full_path' for nil:NilClass

Creating a new group results in a 500 error image

What is the expected correct behavior?

The project or groups should be successfully created

Relevant logs and/or screenshots

{"severity":"ERROR","time":"2025-08-25T20:14:03.058Z","correlation_id":"##################","meta.caller_id":"ProjectsController#create","meta.feature_category":"groups_and_projects","meta.organization_id":1,"meta.remote_ip":"###.###.###.####","meta.user":"####","meta.user_id":#,"meta.client_id":"user/#","message":"Unable to save project. Error: undefined method `full_path' for nil:NilClass"}

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:		
Current User:	###
Using RVM:	no
Ruby Version:	3.2.8
Gem Version:	3.6.9
Bundler Version:2.7.1
Rake Version:	13.0.6
Redis Version:	7.2.10
Sidekiq Version:7.3.9
Go Version:	unknown

GitLab information
Version:	18.3.0
Revision:	f54d72cc517
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	16.8
URL:		https://#######.com
HTTP Clone URL:	https://#########.com/some-group/some-project.git
SSH Clone URL:	###@#############.com:some-group/some-project.git
Using LDAP:	yes
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	14.44.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version: 	18.3.0
- default Git Version: 	2.50.1.gl1

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.44.0 ? ... OK (14.44.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 100 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 9/2 ... yes 9/3 ... yes 12/4 ... yes 13/5 ... yes 13/6 ... yes 13/7 ... yes 14/8 ... yes 365/9 ... yes 365/10 ... yes 59/11 ... yes 8/12 ... yes 13/13 ... yes 9/14 ... yes 17/15 ... yes 9/16 ... yes 13/17 ... yes 13/18 ... yes 13/19 ... yes 59/20 ... yes 59/21 ... yes 13/22 ... yes 365/23 ... yes 16/24 ... yes 14/25 ... yes 14/26 ... yes 13/27 ... yes 59/28 ... yes 13/29 ... yes 365/30 ... yes 59/31 ... yes 15/32 ... yes 9/33 ... yes 371/35 ... yes 59/36 ... yes 9/37 ... yes 365/38 ... yes 59/39 ... yes 329/40 ... yes 19/41 ... yes 6/42 ... yes 19/43 ... yes 13/44 ... yes 13/45 ... yes 19/46 ... yes 30/47 ... yes 4/48 ... yes 32/49 ... yes 13/50 ... yes 30/51 ... yes 33/52 ... yes 34/53 ... yes 14/54 ... yes 16/55 ... yes 7/56 ... yes 13/57 ... yes 14/58 ... yes 16/59 ... yes 365/60 ... yes 365/61 ... yes 365/62 ... yes 365/63 ... yes 365/64 ... yes 365/65 ... yes 365/66 ... yes 365/67 ... yes 365/68 ... yes 365/69 ... yes 365/70 ... yes 365/71 ... yes 365/72 ... yes 365/73 ... yes 13/74 ... yes 15/75 ... yes 36/76 ... yes 36/77 ... yes 365/78 ... yes 13/79 ... yes 13/80 ... yes 13/81 ... yes 13/82 ... yes 19/83 ... yes 36/84 ... yes 5/85 ... yes 329/87 ... yes 33/88 ... yes 9/89 ... yes 15/90 ... yes 13/91 ... yes 7/92 ... yes 6/93 ... yes 13/94 ... yes 40/95 ... yes 13/96 ... yes 59/97 ... yes 14/98 ... yes 14/99 ... yes 9/100 ... yes 13/101 ... yes 13/102 ... yes 9/103 ... yes 30/104 ... yes 13/105 ... yes 20/106 ... yes 15/107 ... yes 6/108 ... yes 33/109 ... yes 9/110 ... yes 33/111 ... yes 6/112 ... yes 338/113 ... yes 9/114 ... yes 9/115 ... yes 14/116 ... yes 9/117 ... yes 49/118 ... yes 13/119 ... yes 50/120 ... yes 365/121 ... yes 30/122 ... yes 14/123 ... yes 13/124 ... yes 51/125 ... yes 365/126 ... yes 365/127 ... yes 365/128 ... yes 58/129 ... yes 371/130 ... yes 58/131 ... yes 9/132 ... yes 58/133 ... yes 13/134 ... yes 14/135 ... yes 61/137 ... yes 13/138 ... yes 58/139 ... yes 58/140 ... yes 58/141 ... yes 64/142 ... yes 365/143 ... yes 18/144 ... yes 13/145 ... yes 58/146 ... yes 58/147 ... yes 58/148 ... yes 14/149 ... yes 58/150 ... yes 13/151 ... yes 58/152 ... yes 58/153 ... yes 59/154 ... yes 30/155 ... yes 30/156 ... yes 14/158 ... yes 365/161 ... yes 47/162 ... yes 78/163 ... yes 64/164 ... yes 58/165 ... yes 13/166 ... yes 64/167 ... yes 56/168 ... yes 63/169 ... yes 58/170 ... yes 58/171 ... yes 30/173 ... yes 329/174 ... yes 58/176 ... yes 58/177 ... yes 371/178 ... yes 13/179 ... yes 365/180 ... yes 77/181 ... yes 30/182 ... yes 13/183 ... yes 85/185 ... yes 13/186 ... yes 13/187 ... yes 13/188 ... yes 13/189 ... yes 365/191 ... yes 15/192 ... yes 13/193 ... yes 371/194 ... yes 63/195 ... yes 13/196 ... yes 88/197 ... yes 13/199 ... yes 13/200 ... yes 58/202 ... yes 13/203 ... yes 63/204 ... yes 365/205 ... yes 30/206 ... yes 14/207 ... yes 19/210 ... yes 91/211 ... yes 30/212 ... yes 338/213 ... yes 13/214 ... yes 365/215 ... yes 14/216 ... yes 98/219 ... yes 365/220 ... yes 14/221 ... yes 329/222 ... yes 58/223 ... yes 14/224 ... yes 365/225 ... yes 338/226 ... yes 315/227 ... yes 91/228 ... yes 13/230 ... yes 329/231 ... yes 30/234 ... yes 365/235 ... yes 9/236 ... yes 58/237 ... yes 58/238 ... yes 58/239 ... yes 58/240 ... yes 58/241 ... yes 350/242 ... yes 4/243 ... yes 30/244 ... yes 4/245 ... yes 371/246 ... yes 14/247 ... yes 13/249 ... yes 13/251 ... yes 387/252 ... yes 58/253 ... yes 30/254 ... yes 30/257 ... yes 396/258 ... yes 79/259 ... yes 405/267 ... yes 405/268 ... yes 405/269 ... yes 405/270 ... yes 405/271 ... yes 405/272 ... yes 405/273 ... yes 404/274 ... yes 404/275 ... yes 404/276 ... yes 404/277 ... yes 404/278 ... yes 404/280 ... yes 404/281 ... yes 404/283 ... yes 404/284 ... yes 404/285 ... yes 404/286 ... yes 404/287 ... yes 404/288 ... yes 404/291 ... yes 402/292 ... yes 399/293 ... yes 399/294 ... yes 399/295 ... yes 399/296 ... yes 399/297 ... yes 399/298 ... yes 399/299 ... yes 399/300 ... yes 399/301 ... yes 399/302 ... yes 399/303 ... yes 399/304 ... yes 399/305 ... yes 399/307 ... yes 399/308 ... yes 399/309 ... yes 13/310 ... yes 30/311 ... yes 365/312 ... yes 30/313 ... yes 7/314 ... yes 13/316 ... yes 465/318 ... yes 30/319 ... yes 13/320 ... yes 13/321 ... yes 13/324 ... yes 371/325 ... yes 371/326 ... yes 5/327 ... yes 9/328 ... yes 13/329 ... yes 371/330 ... yes 371/331 ... yes 13/332 ... yes 484/333 ... yes 9/334 ... yes Redis version >= 6.2.14? ... yes Ruby version >= 3.0.6 ? ... yes (3.2.8) Git user has default SSH configuration? ... yes Active users: ... 29 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Patch release information for backports

If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.

Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.

High-severity bug remediation

To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.

Workaround

A workaround for this issue is disabling Slack integrations using the rails console. See this forum post.

Customer issue: terraform-provider-gitlab#6593 (closed) / Sentry issue: https://new-sentry.gitlab.net/organizations/gitlab/issues/1832238

Edited by Rez