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

issues creation missing iid #22

Closed
glensc opened this issue Apr 21, 2017 · 6 comments
Closed

issues creation missing iid #22

glensc opened this issue Apr 21, 2017 · 6 comments

Comments

@glensc
Copy link
Member

glensc commented Apr 21, 2017

seems required :iid is not filled when creating issues in direct mode. causing issue listing to crash.

https://gitlab.example.net/.../issues

==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 500 Internal Server Error in 156ms (ActiveRecord: 11.8ms)  

ActionView::Template::Error (No route matches {:action=>"show", :controller=>"projects/issues", :id=>#<Issue id: 7956, title: "
miniprofile: remove \"view profile\" link for DID us...", assignee_id: 1, author_id: 1, project_id: 166, created_at: "2015-03-1
0 08:38:57", updated_at: "2015-03-10 08:38:57", position: 0, branch_name: nil, description: "Screenshot: \n\nIn co...", milestone_id: 2419, state: "opened", iid: nil, updated_by_id: nil, confidential: false, deleted_at: nil
, moved_to_id: nil, due_date: nil, lock_version: nil, title_html: nil, description_html: nil, time_estimate: 0, relative_positi
on: nil>, :namespace_id=>#<Group id: 39, name: "comment", path: "comment", owner_id: nil, created_at: "2017-04-06 11:09:12", up
dated_at: "2017-04-06 11:09:12", type: "Group", description: "", avatar: nil, share_with_group_lock: false, visibility_level: 1
0, request_access_enabled: false, deleted_at: nil, lfs_enabled: nil, description_html: nil, parent_id: nil>, :project_id=>#<Pro
ject id: 166, name: "comment", path: "comment", description: "", created_at: "2017-03-31 08:40:49", updated_at: "2017-04-06 11:
09:40", creator_id: 2, namespace_id: 39, last_activity_at: "2017-04-21 20:45:09", import_url: nil, visibility_level: 10, archiv
ed: false, avatar: nil, import_status: "none", star_count: 0, import_type: nil, import_source: nil, import_error: nil, ci_id: n
il, shared_runners_enabled: true, runners_token: "", build_coverage_regex: nil, build_allow_git_fetch: true
, build_timeout: 3600, pending_delete: false, public_builds: true, last_repository_check_failed: false, last_repository_check_a
t: "2017-04-01 09:20:14", container_registry_enabled: true, only_allow_merge_if_pipeline_succeeds: false, has_external_issue_tr
acker: false, repository_storage: "default", request_access_enabled: false, has_external_wiki: false, lfs_enabled: nil, descrip
tion_html: "", only_allow_merge_if_all_discussions_are_resolved: false>} missing required keys: [:id]):
    1: %li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue), data: { labels: issue.label_ids, id: is
sue.id } }
    2:   .issue-box
    3:     - if @bulk_edit
    4:       .issue-check
  app/helpers/gitlab_routing_helper.rb:82:in `issue_path'
  app/views/projects/issues/_issue.html.haml:1:in `_app_views_projects_issues__issue_html_haml___1240390849716462797_6991371870
2360'
  app/views/projects/issues/_issues.html.haml:2:in `_app_views_projects_issues__issues_html_haml___2424223834673794016_69913717
256020'
  app/views/projects/issues/index.html.haml:34:in `_app_views_projects_issues_index_html_haml___430271349031898150_699137755102
80'
  app/controllers/projects/issues_controller.rb:51:in `index'
  lib/gitlab/middleware/multipart.rb:93:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:i
# gitlab-rails console

irb(main):033:0* Issue.find_by(id: 7956)
=> #<Issue id: 7956, title: "miniprofile: remove \"view profile\" link for DID us...", assignee_id: 1, author_id: 1, project_id: 166, created_at: "2015-03-10 08:38:57", updated_at: "2015-03-10 08:38:57", position: 0, branch_name: nil, description: "Screenshot: \n\nIn co...", milestone_id: 2419, state: "opened", iid: nil, updated_by_id: nil, confidential: false, deleted_at: nil, moved_to_id: nil, due_date: nil, lock_version: nil, title_html: nil, description_html: nil, time_estimate: 0, relative_position: nil>
irb(main):034:0> 
@glensc
Copy link
Member Author

glensc commented Apr 21, 2017

also not sure how to get rid of such broken entries

irb(main):039:0> Issue.find_by(id: 7956).delete
NoMethodError: undefined method `state' for #<ActiveRecord::ConnectionAdapters::NullTransaction:0x007f762ba92bc8>
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:238:in `transaction_state'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.8/lib/active_record/transactions.rb:335:in `add_to_transaction'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/paranoia-2.2.0/lib/paranoia.rb:96:in `delete'
        from (irb):39
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in `start'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in `start'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in `console'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:9:in `require'
        from bin/rails:9:in `<main>'
irb(main):040:0> 

@glensc
Copy link
Member Author

glensc commented Apr 21, 2017

this will cleanup:

irb(main):052:0> Issue.where(iid: nil).size
=> 520

irb(main):060:0> for issue in Issue.where(iid: nil) do puts issue.destroy end
#<Issue:0x007f7632aec658>
#<Issue:0x007f7632ac5bc0>
...

@crayfishuk
Copy link

I'm seeing the same thing. Issues are imported and show against milestones/labels - but any attempt at issue listing causes a 500 error. Cleanup script above deletes all imported issues...

@glensc
Copy link
Member Author

glensc commented Aug 21, 2018

the fix is somewhere here: #48

as i no longer had this error.

@glensc glensc closed this as completed Aug 21, 2018
@crayfishuk
Copy link

Wicked. Thanks - will have a wade through the list :-)

@glensc
Copy link
Member Author

glensc commented Aug 21, 2018

just checkout that branch and things will likely work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
First usable release
Awaiting triage
Development

No branches or pull requests

3 participants