GITLAB常见问题总结

Troubleshooting GitLab Pages administration (FREE SELF)

原文地址


stage: Plan
group: Knowledge
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

This page contains a list of issues you might encounter when administering GitLab Pages.

How to see GitLab Pages logs

You can see Pages daemon logs by running:

sudo gitlab-ctl tail gitlab-pages

You can also find the log file in /var/log/gitlab/gitlab-pages/current.

unsupported protocol scheme \"\""

If you see the following error:

{"error":"failed to connect to internal Pages API: Get \"/api/v4/internal/pages/status\": unsupported protocol scheme \"\"","level":"warning","msg":"attempted to connect to the API","time":"2021-06-23T20:03:30Z"}

It means you didn’t set the HTTP(S) protocol scheme in the Pages server settings.
To fix it:

  1. Edit /etc/gitlab/gitlab.rb:

    gitlab_pages['gitlab_server'] = "https://<your_gitlab_server_public_host_and_port>"
    gitlab_pages['internal_gitlab_server'] = "https://<your_gitlab_server_private_host_and_port>" # optional, gitlab_pages['gitlab_server'] is used as default
    
  2. Reconfigure GitLab:

    sudo gitlab-ctl reconfigure
    

502 error when connecting to GitLab Pages proxy when server does not listen over IPv6

In some cases, NGINX might default to using IPv6 to connect to the GitLab Pages
service even when the server does not listen over IPv6. You can identify when
this is happening if you see something similar to the log entry below in the
gitlab_pages_error.log:

2020/02/24 16:32:05 [error] 112654#0: *4982804 connect() failed (111: Connection refused) while connecting to upstream, client: 123.123.123.123, server: ~^(?<group>.*)\.pages\.example\.com$, request: "GET /-/group/project/-/jobs/1234/artifacts/artifact.txt HTTP/1.1", upstream: "http://[::1]:8090//-/group/project/-/jobs/1234/artifacts/artifact.txt", host: "group.example.com"

To resolve this, set an explicit IP and port for the GitLab Pages listen_proxy setting
to define the explicit address that the GitLab Pages daemon should listen on:

gitlab_pages['listen_proxy'] = '127.0.0.1:8090'

Intermittent 502 errors or after a few days

If you run Pages on a system that uses systemd and
tmpfiles.d,
you may encounter intermittent 502 errors trying to serve Pages with an error similar to:

dial tcp: lookup gitlab.example.com on [::1]:53: dial udp [::1]:53: connect: no route to host"

GitLab Pages creates a bind mount
inside /tmp/gitlab-pages-* that includes files like /etc/hosts.
However, systemd may clean the /tmp/ directory on a regular basis so the DNS
configuration may be lost.

To stop systemd from cleaning the Pages related content:

  1. Tell tmpfiles.d to not remove the Pages /tmp directory:

    echo 'x /tmp/gitlab-pages-*' >> /etc/tmpfiles.d/gitlab-pages-jail.conf
    
  2. Restart GitLab Pages:

    sudo gitlab-ctl restart gitlab-pages
    

Unable to access GitLab Pages

If you can’t access your GitLab Pages (such as receiving 502 Bad Gateway errors, or a login loop)
and in your Pages log shows this error:

"error":"retrieval context done: context deadline exceeded","host":"root.docs-cit.otenet.gr","level":"error","msg":"could not fetch domain information from a source"
  1. Add the following to /etc/gitlab/gitlab.rb:

    gitlab_pages['internal_gitlab_server'] = 'http://localhost:8080'
    
  2. Restart GitLab Pages:

    sudo gitlab-ctl restart gitlab-pages
    

Failed to connect to the internal GitLab API

If you see the following error:

ERRO[0010] Failed to connect to the internal GitLab API after 0.50s  error="failed to connect to internal Pages API: HTTP status: 401"

If you are Running GitLab Pages on a separate server
you must copy the /etc/gitlab/gitlab-secrets.json file
from the GitLab server to the Pages server after upgrading to GitLab 13.3,
as described in that section.

Other reasons may include network connectivity issues between your
GitLab server and your Pages server such as firewall configurations or closed ports.
For example, if there is a connection timeout:

error="failed to connect to internal Pages API: Get \"https://gitlab.example.com:3000/api/v4/internal/pages/status\": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"

Pages cannot communicate with an instance of the GitLab API

If you use the default value for domain_config_source=auto and run multiple instances of GitLab
Pages, you may see intermittent 502 error responses while serving Pages content. You may also see
the following warning in the Pages logs:

WARN[0010] Pages cannot communicate with an instance of the GitLab API. Please sync your gitlab-secrets.json file https://gitlab.com/gitlab-org/gitlab-pages/-/issues/535#workaround. error="pages endpoint unauthorized"

This can happen if your gitlab-secrets.json file is out of date between GitLab Rails and GitLab
Pages. Follow steps 8-10 of Running GitLab Pages on a separate server,
in all of your GitLab Pages instances.

Intermittent 502 errors when using an AWS Network Load Balancer and GitLab Pages

Connections will time out when using a Network Load Balancer with client IP preservation enabled and the request is looped back to the source server.
This can happen to GitLab instances with multiple servers
running both the core GitLab application and GitLab Pages. This can also happen when a single
container is running both the core GitLab application and GitLab Pages.

AWS recommends using an IP target type
to resolve this issue.

Turning off client IP preservation
may resolve this issue when the core GitLab application and GitLab Pages run on the same host or
container.

500 error with securecookie: failed to generate random iv and Failed to save the session

This problem most likely results from an out-dated operating system.
The Pages daemon uses the securecookie library to get random strings via crypto/rand in Go.
This requires the getrandom system call or /dev/urandom to be available on the host OS.
Upgrading to an officially supported operating system is recommended.

The requested scope is invalid, malformed, or unknown

This problem comes from the permissions of the GitLab Pages OAuth application. To fix it:

  1. On the left sidebar, select Search or go to.
  2. Select Admin Area.
  3. On the left sidebar, select Applications > GitLab Pages.
  4. Edit the application.
  5. Under Scopes, ensure that the api scope is selected.
  6. Save your changes.

When running a separate Pages server,
this setting needs to be configured on the main GitLab server.

Workaround in case no wildcard DNS entry can be set

If the wildcard DNS prerequisite can’t be met, you can still use GitLab Pages in a limited fashion:

  1. Move
    all projects you need to use Pages with into a single group namespace, for example pages.
  2. Configure a DNS entry without the *.-wildcard, for example pages.example.io.
  3. Configure pages_external_url http://example.io/ in your gitlab.rb file.
    Omit the group namespace here, because it automatically is prepended by GitLab.

Pages daemon fails with permission denied errors

If /tmp is mounted with noexec, the Pages daemon fails to start with an error like:

{"error":"fork/exec /gitlab-pages: permission denied","level":"fatal","msg":"could not create pages daemon","time":"2021-02-02T21:54:34Z"}

In this case, change TMPDIR to a location that is not mounted with noexec. Add the following to
/etc/gitlab/gitlab.rb:

gitlab_pages['env'] = {'TMPDIR' => '<new_tmp_path>'}

Once added, reconfigure with sudo gitlab-ctl reconfigure and restart GitLab with
sudo gitlab-ctl restart.

The redirect URI included is not valid. when using Pages Access Control

You may see this error if pages_external_url was updated at some point of time. Verify the following:

  1. Check the System OAuth application:

    1. On the left sidebar, select Search or go to.
    2. Select Admin Area.
    3. Select Applications and then Add new application.
    4. Ensure the Callback URL/Redirect URI is using the protocol (HTTP or HTTPS) that
      pages_external_url is configured to use.
  2. The domain and path components of Redirect URI are valid: they should look like projects.<pages_external_url>/auth.

500 error cannot serve from disk

If you get a 500 response from Pages and encounter an error similar to:

ERRO[0145] cannot serve from disk                        error="gitlab: disk access is disabled via enable-disk=false" project_id=27 source_path="file:///shared/pages/@hashed/67/06/670671cd97404156226e507973f2ab8330d3022ca96e0c93bdbdb320c41adcaf/pages_deployments/14/artifacts.zip" source_type=zip

It means that GitLab Rails is telling GitLab Pages to serve content from a location on disk,
however, GitLab Pages was configured to disable disk access.

To enable disk access:

  1. Enable disk access for GitLab Pages in /etc/gitlab/gitlab.rb:

    gitlab_pages['enable_disk'] = true
    
  2. Reconfigure GitLab.

httprange: new resource 403

If you see an error similar to:

{"error":"httprange: new resource 403: \"403 Forbidden\"","host":"root.pages.example.com","level":"error","msg":"vfs.Root","path":"/pages1/","time":"2021-06-10T08:45:19Z"}

And you run pages on the separate server syncing files via NFS, it may mean that
the shared pages directory is mounted on a different path on the main GitLab server and the
GitLab Pages server.

In that case, it’s highly recommended you to configure
object storage and migrate any existing pages data to it.

Alternatively, you can mount the GitLab Pages shared directory to the same path on
both servers.

GitLab Pages doesn’t work after upgrading to GitLab 14.0 or above

GitLab 14.0 introduces a number of changes to GitLab Pages which may require manual intervention.

  1. Firstly follow the migration guide.
  2. Try to upgrade to GitLab 14.3 or above. Some of the issues were fixed in GitLab 14.1, 14.2 and 14.3.
  3. If it doesn’t work, see GitLab Pages logs, and if you see any errors there then search them on this page.

WARNING:
In GitLab 14.0-14.2 you can temporarily enable legacy storage and configuration mechanisms.

To do that:

  1. Describe the issue you’re seeing in the migration feedback issue.

  2. Edit /etc/gitlab/gitlab.rb:

    gitlab_pages['use_legacy_storage'] = true
    
  3. Reconfigure GitLab.

GitLab Pages deploy job fails with error “is not a recognized provider”

If the pages job succeeds but the deploy job gives the error “is not a recognized provider”:

image.png

The error message is not a recognized provider could be coming from the fog gem that GitLab uses to connect to cloud providers for object storage.

To fix that:

  1. Check your gitlab.rb file. If you have gitlab_rails['pages_object_store_enabled'] enabled, but no bucket details have been configured, either:

    • Configure object storage for your Pages deployments, following the S3-compatible connection settings guide.
    • Store your deployments locally, by commenting out that line.
  2. Save the changes you made to your gitlab.rb file, then reconfigure GitLab.

404 error The page you're looking for could not be found

If you get a 404 Page Not Found response from GitLab Pages:

  1. Check .gitlab-ci.yml contains the job pages:.
  2. Check the current project’s pipeline to confirm the job pages:deploy is being run.

Without the pages:deploy job, the updates to your GitLab Pages site are never published.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/674673.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

MWORKS车辆动力性经济性与热管理联合应用篇

一、引言 随着科技的飞速发展、环保意识的日益增强以及国家政策的大力支持&#xff0c;新能源汽车已经不再是遥不可及的未来科技&#xff0c;而是逐步走进千家万户&#xff0c;成为我们日常生活中不可或缺的一部分。然而&#xff0c;每到冬季的来临&#xff0c;纯电动汽车面临…

Linux shell编程学习笔记56:date命令——显示或设置系统时间与日期

0 前言 2024年的网络安全检查又开始了&#xff0c;对于使用基于Linux的国产电脑&#xff0c;我们可以编写一个脚本来收集系统的有关信息。在收集的信息中&#xff0c;应该有一条是搜索信息的时间。 1. date命令 的功能、格式和选项说明 我们可以使用命令 date --help 来查看 d…

巧用Jmeter Debug sampler获取变量信息

Jmeter Debug sampler介绍 Jmeter Debug sampler 可以帮助我们解决如下问题&#xff1a; debug参数化的变量取值是否正确 debug正则表达式提取器&#xff08;或json提取器&#xff09;提取的值是否正确 查看 JMeter 属性 具体使用方法 前提条件&#xff1a;添加查看结果树…

【Python】【matLab】模拟退火算法求二元高次函数最小值

一、目标函数 求二元高次函数的最小值。目标函数选择&#xff1a; 用于测试算法的简单的目标函数&#xff1a; 二、Python代码实现 import numpy as np# 目标函数&#xff08;2变量&#xff09; def objective_function(x):return x[0] ** 2 2 * x[0] - 15 4 * 4 * 2 * x[…

【开发心得】三步本地化部署llama3大模型

目录 第一步&#xff1a;启动ollama 第二步&#xff1a;启动dify 第三步&#xff1a;配置模型&#xff08;截图&#xff09; 最近llama3很火&#xff0c;本文追击热点&#xff0c;做一个本地化部署的尝试&#xff0c;结果还成功了&#xff01; 当然也是站在别人的肩膀上&…

DevOps中如何高效开展手工和自动化测试

在快速发展的软件开发行业中&#xff0c;DevOps实践已经成为提高软件交付速度和质量的关键。DevOps是一种文化和实践的集合&#xff0c;旨在促进开发&#xff08;Dev&#xff09;和运维&#xff08;Ops&#xff09;团队之间的协作和通信。测试作为DevOps生命周期中的重要组成部…

安装打开 ubuntu-22.04.3-LTS 报错 解决方案

安装打开 ubuntu-22.04.3-LTS 报错 解决方案 WslRegisterDistribution failed with error: 0x800701bc Error: 0x800701bc WSL 2 ??? https://aka.ms/wsl2kernel 1、确保【windows 功能】打开了【虚拟机】。 键盘上按 WIN R 打开【运行】&#xff0c;输入 【 control 】&…

树莓派4B 学习笔记2:GPIO介绍_第一个Python程序_点灯

今日开始学习树莓派4B 4G&#xff1a;&#xff08;Raspberry Pi&#xff0c;简称RPi或RasPi&#xff09; GPIO介绍_第一个Python程序_Python点灯 文章提供测试代码讲解、完整代码贴出、测试效果图 目录 树莓派4B 引脚与外设图&#xff1a; 树莓派常用命令&#xff1a; 第一个…

今日好料推荐(ARM嵌入式)

今日好料推荐&#xff08;ARM嵌入式&#xff09; 参考资料在文末获取&#xff0c;关注我&#xff0c;获取优质资源。 给我留言&#xff0c;会帮大家寻找需要的资料。 ARM 嵌入式系统 嵌入式系统在现代电子设备中扮演着至关重要的角色&#xff0c;从智能手机到工业自动化&am…

【网络技术】【Kali Linux】Wireshark嗅探(十六)TLS(传输层安全协议)报文捕获及分析

往期 Kali Linux 上的 Wireshark 嗅探实验见博客&#xff1a; 【网络技术】【Kali Linux】Wireshark嗅探&#xff08;一&#xff09;ping 和 ICMP 【网络技术】【Kali Linux】Wireshark嗅探&#xff08;二&#xff09;TCP 协议 【网络技术】【Kali Linux】Wireshark嗅探&…

springboot undertow 文件上传文件过大异常

io.undertow.server.RequestTooBigException: UT000020 Connection terminated as request was larger than xxxx 修改yaml文件中关于undertow的配置项 server:undertow:# HTTP POST请求最大的大小# 默认0&#xff0c;无限制max-http-post-size: ${SERVER_UNDERTOW_MAX_HTTP_…

Jetson Nano集成探索大象机器人myAGV上的 SLAM 算法!

引言 大家好&#xff0c;最近新入手了一台myAGV JN这是elephant robotics在myAGV升级后的版本。最近有对SLAM相关知识感兴趣&#xff0c;想深入了解一些关于ROS中SLAM的一些算法和规划&#xff0c;跟据官方提供的gitbook&#xff0c;主要使用到了gmapping算法来建图导航实现功能…

计算机类专业应该怎么选学校和方向?优先选这些!

&#x1f446;点击关注 获取更多编程干货&#x1f446; 高考季临近&#xff0c;不少有意向报考计算机专业的同学在为院校和细分专业的选择而苦恼&#xff0c;以下是一些建议&#xff0c;希望能帮到大家&#xff01; 01 选校建议 在选择计算机科学&#xff08;CS&#xff09…

第二证券炒股知识:股票内盘外盘代表什么意思?

股票内盘是主动性卖盘&#xff0c;表明以买入价成交的股数&#xff0c;持股的投资者主动以等于或是低于买一、买二、买三、买四、买五的价格卖出手中持有的股份&#xff0c;买入成交数量核算参加内盘。 股票外盘是主动性买盘&#xff0c;表明以卖出价成交的股数&#xff0c;场…

Vuex 的安装与配置

聚沙成塔每天进步一点点 本文内容 ⭐ 专栏简介Vuex 的安装与配置1. 安装 Vuex使用 npm 安装使用 yarn 安装 2. 配置 Vuex创建和配置 store将 store 注入到 Vue 实例中 3. 在组件中使用 Vuex访问 State提交 Mutation分发 Action使用 Getter 原理解析小结 ⭐ 写在最后 ⭐ 专栏简介…

2. MySQL 数据类型和存储引擎

文章目录 【 1. 数据类型 】1.1 数值类型1.1.1 整型1.1.2 小数1.1.3 数值类型的选择 1.2 日期和时间YEAR 年TIME 时间DATE 日期DATETIME 日期时间TIMESTAMP 时间戳日期和时间的选择 1.3 文本字符串CHAR 固定字符串、VARCHAR 可变字符串TEXT 文本ENUM 枚举SET 集合字符串类型的选…

k8s-部署对象存储minio

环境信息 minio版本 :最新 k8s 版本1.22 使用nfs作为共享存储 一.单节点安装包部署 脚本部署&#xff0c;一键部署&#xff0c;单节点应用于数据量小&#xff0c;一些缓存存储&#xff0c;比如gitlab-runner的产物数据&#xff0c;maven的打包依赖数据 #!/bin/bash# 步骤…

如何高效管理自己的时间,可以从这几个方向着手

如果你是上班族&#xff0c;天选打工人&#xff0c;你的绝大多数时间都属于老板&#xff0c;能够自己支配的时间其实并不多&#xff0c;所以你可能察觉不到时间管理的重要性。 但如果你是自由职业者或者创业者&#xff0c;想要做出点成绩&#xff0c;那你就需要做好时间管理&am…

jadx-gui-1.5 反编译工具使用教程 反混淆 Java android 查看签名

JADX&#xff1a;JADX是一个强大的反编译工具&#xff0c;它支持命令行和图形界面操作。除了基本的反编译功能外&#xff0c;JADX还提供了反混淆功能&#xff0c;有助于提高反编译后代码的可读性。 在Android开发和安全分析领域&#xff0c;反编译工具扮演着至关重要的角色。这…

VSCode插件Sort Lines

Sort Lines是一款VSCode中的扩展&#xff0c;可以帮助你对所选文本或整个文件中的行进行排序。可以给你按字母大小排序&#xff08;升序、降序&#xff09;&#xff0c;也可以进行排序去重。而且还能将所有文本打乱顺序。做短文本分类的训练&#xff0c;清洗数据集的时候&#…