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

Error while upgrading to OJS 3.4 if the journal's URL/domain has been changed #9810

Closed
jonasraoni opened this issue Mar 20, 2024 · 4 comments
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Milestone

Comments

@jonasraoni
Copy link
Contributor

jonasraoni commented Mar 20, 2024

Describe the bug
At the I8508_ConvertCurrentLogFile migration, the error below happens if the config.inc.php isn't using the production URL.

Error: File /files/usageStats/usageEventLogs/usage_events_20240319.log could not be successfully converted.

  1. As a sysadmin, I might decide to upgrade the system under a temporary host, and this error is unexpected to me and tough to reason about.
    Just a warning like ensure you've got the right base_url before migrating might not be enough, so I think we can be more pro-active and attempt to convert the file at this point (at least a couple of lines to ensure that it's ok):

    // check if there are usage stats log files older than yesterday

  2. As the code has a couple of continues, I think it's better to ensure that at least one entry really failed before assuming that the file couldn't be processed (e.g. if the file just has one entry, an internal apache request then the tool will not process anything and mistakenly assume that it failed).

To Reproduce

  1. Setup a different base_url
  2. Attempt to upgrade with a pending log file at the {$files_dir}/usageStats/usageEventLogs
  3. See error

What application are you using?
OJS 3.4

PRs:
stable-3_4_0:

main:

@jonasraoni jonasraoni added the Bug:1:Low A bug that does not have a severe consequence or affects a small number of users. label Mar 20, 2024
@jonasraoni jonasraoni added this to the 3.4.0-x milestone Mar 20, 2024
@jonasraoni
Copy link
Contributor Author

@bozana check if it makes sense what I wrote.

@bozana
Copy link
Collaborator

bozana commented Mar 28, 2024

Hi @jonasraoni,

  1. Yes, the right URL is needed, because we extract the context path, page, operation, args from the URL. For this we first remove the base URL (s. https://github.com/pkp/pkp-lib/blob/stable-3_4_0/classes/cliTool/traits/ConvertLogFile.php#L320).
    And, yes, maybe we can improve the preflight check. It will need some code, but...
  2. Currently we expect at least one line to be successfully converted in order to see the conversion as successful. I think this is OK/correct, because we would not need to create an empty new file. We could eventually track if error occurs and in case it does not occur, we can display a different message, e.g. that the new file does not contain any entries so it is not created. But, I think this case is (almost) not possible to happen, thus this should have very low priority.

@jonasraoni
Copy link
Contributor Author

  1. We had this issue on a large installation, I did some workarounds to not restart from beginning, but a standard user wouldn't have this option. Also, it was difficult to understand why exactly it failed, I had to debug the code.

  2. I also think it's unlikely to happen, I just saw that the possibility exists and wanted to warn :)

@jonasraoni jonasraoni changed the title Error while upgrading to OJS 3.4 Error while upgrading to OJS 3.4 if the journal/domain URL has been changed May 20, 2024
@jonasraoni jonasraoni changed the title Error while upgrading to OJS 3.4 if the journal/domain URL has been changed Error while upgrading to OJS 3.4 if the journal's URL/domain has been changed May 20, 2024
bozana added a commit to bozana/pkp-lib that referenced this issue Jul 2, 2024
bozana added a commit to bozana/ojs that referenced this issue Jul 2, 2024
@bozana
Copy link
Collaborator

bozana commented Jul 2, 2024

@jonasraoni, could you please review the PR above?
Thanks a lot!

bozana added a commit to bozana/pkp-lib that referenced this issue Jul 4, 2024
bozana added a commit to bozana/ojs that referenced this issue Jul 4, 2024
bozana added a commit to bozana/omp that referenced this issue Jul 4, 2024
bozana added a commit to bozana/ops that referenced this issue Jul 4, 2024
bozana added a commit to bozana/ojs that referenced this issue Jul 4, 2024
bozana added a commit to bozana/omp that referenced this issue Jul 4, 2024
bozana added a commit to bozana/ops that referenced this issue Jul 4, 2024
bozana added a commit to bozana/omp that referenced this issue Jul 4, 2024
bozana added a commit to bozana/pkp-lib that referenced this issue Jul 10, 2024
bozana added a commit to bozana/ojs that referenced this issue Jul 10, 2024
bozana added a commit to bozana/omp that referenced this issue Jul 10, 2024
bozana added a commit to bozana/ops that referenced this issue Jul 10, 2024
bozana added a commit that referenced this issue Jul 10, 2024
#9810 check if the URL in the usage stats log file corresp…
bozana added a commit to pkp/ojs that referenced this issue Jul 10, 2024
pkp/pkp-lib#9810 submodule update ##bozana/9810-3_4_0##
bozana added a commit to pkp/omp that referenced this issue Jul 10, 2024
pkp/pkp-lib#9810 submodule update ##bozana/9810-3_4_0##
bozana added a commit to pkp/ops that referenced this issue Jul 10, 2024
pkp/pkp-lib#9810 submodule update ##bozana/9810-3_4_0##
bozana added a commit to bozana/pkp-lib that referenced this issue Jul 10, 2024
bozana added a commit that referenced this issue Jul 10, 2024
#9810 check if the URL in the usage stats log file corresp…
@bozana bozana closed this as completed Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:1:Low A bug that does not have a severe consequence or affects a small number of users.
Projects
None yet
Development

No branches or pull requests

2 participants