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

$GITHUB_OUTPUT not available between jobs #28091

Closed
kristophercrawford opened this issue Nov 16, 2023 · 15 comments
Closed

$GITHUB_OUTPUT not available between jobs #28091

kristophercrawford opened this issue Nov 16, 2023 · 15 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug

Comments

@kristophercrawford
Copy link

Description

I copied the workflow file from #24230 and ran this on my Gitea instance. The result of the jobs is captured below in screenshots.

image image

Gitea Version

1.21.0+rc2-55

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.30.2

Operating System

Ubuntu 22.04

How are you running Gitea?

Pre-compiled binary for arm64 on an Orange Pi 5, running through systemd (gitea and act_runner).

Database

MySQL/MariaDB

@kristophercrawford kristophercrawford changed the title $GITHUB_OUTPUT not available between steps or jobs $GITHUB_OUTPUT not available between jobs Nov 16, 2023
@lng2020 lng2020 added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Nov 17, 2023
@lng2020

This comment was marked as outdated.

@ednxzu
Copy link

ednxzu commented Nov 26, 2023

Same thing,
I opened an issue here because I'm not sure whether it is a gitea or act runner problem.

@yp05327
Copy link
Contributor

yp05327 commented Nov 29, 2023

I know the reason.
I think this was fixed by #28149

The output results will be saved in DB, but before this fix, the target table does not exsit.
So try the latest version, or add this table by yourself, can fix this issue.

image
↑ Your hello world, timestamp and so on should be here, but this table is missing, so you can not get them in job2.

@ednxzu
Copy link

ednxzu commented Nov 29, 2023

Yup, moving to 1.21.1 worked for me. Thanks for looking into it. @kristophercrawford are you still having the issue ?

@lng2020 lng2020 added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Nov 29, 2023
@kristophercrawford
Copy link
Author

No change after updating to Gitea version 1.21.1. Where is the gitea.db file located? I am using the compiled binary installation file on a physical machine running MySQL as the backend database.

image

@yp05327
Copy link
Contributor

yp05327 commented Nov 29, 2023

I use sqlite for testing and it saves data into gitea.db file.
But it should have no difference between different databases.

If you can access your database, you can check whether there‘s a table named action_task_output and any data in this table.
Or if you can get your Gitea instance's logs, you can check whether there are some logs like Table gitea.action_task_output doesn't exist.
image

If the table is existing, but output still don't work. Maybe there are some other issues.

@kristophercrawford
Copy link
Author

Here is what I am seeing on the db side:

MariaDB [gitea]> describe action_task_output;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| id           | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| task_id      | bigint(20)   | YES  | MUL | NULL    |                |
| output_key   | varchar(255) | YES  |     | NULL    |                |
| output_value | mediumtext   | YES  |     | NULL    |                |
+--------------+--------------+------+-----+---------+----------------+
4 rows in set (0.002 sec)

MariaDB [gitea]> select * from action_task_output\G
*************************** 1. row ***************************
          id: 1
     task_id: 822
  output_key: output2
output_value: 8c8c7b6b-ef4b-45bb-a87c-5613a3e9c224
*************************** 2. row ***************************
          id: 2
     task_id: 822
  output_key: output1
output_value: 2023-11-29T12:17:08+00:00
2 rows in set (0.001 sec)

MariaDB [gitea]>

No errors in the gitea.log after upgrading to 1.21.1. The log message here is from before the upgrade.

root@dev-pi:/var/lib/gitea/log# grep '\[E\]' gitea.log
2023/11/29 12:08:05 ...ions/runner/utils.go:45:pickTask() [E] Cannot find needs for task 821: FindTaskOutputByTaskID: Error 1146 (42S02): Table 'gitea.action_task_output' doesn't exist

@yp05327
Copy link
Contributor

yp05327 commented Nov 29, 2023

It seems that we have another issue here. 😕

@kristophercrawford
Copy link
Author

Fresh install of 1.21.1 works on bare metal, upgrading from 1.21.0+rc2-55 to 1.21.1 is what didn't work for me.

@yp05327
Copy link
Contributor

yp05327 commented Nov 30, 2023

Fresh install 1.21.0+rc2, run the workflow, it don't work. Then upgrade it to 1.21.1, rerun the workflow, it worked.
Tried both Mysql 8.0.28 and Sqlite3. 😕

ps: I can only get 1.21.0+rc2 from dl.gitea.com, where did you get 1.21.0+rc2-55?

@kristophercrawford
Copy link
Author

I believe I got it from here: https://dl.gitea.com/gitea/1.21.0-rc2/

Also, I think I figured out our installation differences. I am also using haproxy to terminate ssl for gitea and perform a port translation from 443 on the outside to 3000 on the gitea server. If I disable that by changing the ROOT_URL and access gitea directly and run the same workflow, the data populates as expected in the second job.

Moving the ROOT_URL back to the external domain breaks the output on the second job.

@yp05327
Copy link
Contributor

yp05327 commented Nov 30, 2023

Thanks for your test and report. I think this information is helpful and important for us to detect the porblem.

@yp05327
Copy link
Contributor

yp05327 commented Nov 30, 2023

Which ROOT_URL (Gitea instance URL) when you register the runner?

@kristophercrawford
Copy link
Author

I have tried setting act_runner to use 127.0.0.1:3000, 192.168.10.88:3000, and my external domain. The only time I am seeing output in the job2 data is when I have the ROOT_URL set to the internal IP of 192.168.10.88:3000.

@kristophercrawford
Copy link
Author

kristophercrawford commented Nov 30, 2023

Actually, disregard all of what I said. I was only selecting re-run all jobs after changing my ROOT_URL and observing no in output in the job2 data. I believe what I am observing now is a different bug (This one #25925).

If I switch the ROOT_URL to the external domain and make a new change and commit to the repo, I see output in job2 data as expected.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail type/bug
Projects
None yet
Development

No branches or pull requests

4 participants