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

mysql limit of max amount of activities ? #681

Closed
bjdros opened this issue Apr 6, 2019 · 18 comments
Closed

mysql limit of max amount of activities ? #681

bjdros opened this issue Apr 6, 2019 · 18 comments

Comments

@bjdros
Copy link

bjdros commented Apr 6, 2019

Using kimai2 in windows10 with the XAMPP application, i have it all working but when i try to create a new timesheet with customer id 326, i can not choose anymore the activity in the pulldown menu.
All goes well till customer id 325.
I dont understand why it goes wrong when choosing customer id 326.
Is there a limit of max amount of activities ?

I inserted into the customers, activities, projects tables, records with a sql file like this

LOAD DATA LOW_PRIORITY LOCAL INFILE 'D:\xampp\htdocs\kimai2\activities.csv' INTO TABLE kimai2_activities FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (
id,
project_id,
NAME,
comment,
visible,
fixed_rate,
hourly_rate
);

Here the amount of records i inserted into each table

image

Below a the timesheet screen with the last id (customer 325) where i can choose the activity without a problem

image

And here where it goes wrong at customer id 326 where i can not choose anymore an activity in the pulldown menu

image

  • OS: Windows10

  • Browser: chrome

  • Versión 73.0.3683.86 (Build oficial) (64 bits)

  • Kimai 2 - 0.8.1

  • Apache 2.4.38, MariaDB 10.1.38, PHP 7.2.16, , XAMPP Control Panel 3.2.2

Thanks, Brienen

@kevinpapst
Copy link
Member

kevinpapst commented Apr 6, 2019

Are these global activities?
Do you have anything in var/logs/prod.log?
Anything in your browser console when changing the customer? Probably the API runs for any reason out of memory and does not return the list of activities.

Edit:
By looking at the screenshot and amount of entries I assume the activities are not global. What if you filter the activity admin screen for the customer & project, does that work?

@bjdros
Copy link
Author

bjdros commented Apr 7, 2019

hi kevin,

thanks for the fast response,
i checked the prod.log but is empty.
i did a clear and warmup of the prod

image

and the activities are not global.
here the customer that has all its activities (id 325)
image

and here the customer (id 326) that does have anymore none activities

image

i dont know how to see my browser console...
ok so it might be a mysql memory issue.

@bjdros
Copy link
Author

bjdros commented Apr 7, 2019

i tried a lot, tweaking the my,ini variables but no success

key_buffer
max_allowed_packet
sort_buffer_size
net_buffer_length
read_buffer_size

if you got more ideas let me know.

thanks, brienen

@kevinpapst
Copy link
Member

You know how to tweak Mysql settings but not how to open your browser console / network tab?
http://www.lmgtfy.com/?q=how+to+open+my+browser+console

How do you know that there are existing and visible activities for this customer?

@bjdros
Copy link
Author

bjdros commented Apr 7, 2019

No, I dont know how to tweak mysql, i just changed the variables but nothing changed.
Ok i found the browser console, thanks for the link.

I know there are existing and visible activities for this customer since i inserted for each customer 15 activities with visible = 1 with the load data sql file.

@kevinpapst
Copy link
Member

Then please change to the network tab within your browser tools (the console is one of the tabs) and check what happens after you change the project or customer.

There should be a request to the api happening with an URL like /api/activities?project=xx&orderBy=name&visible=1. Does that request have the status 200 or 500?
Bildschirmfoto 2019-04-07 um 13 42 06

If its 200, please click it and check the "preview". What inside?
Bildschirmfoto 2019-04-07 um 13 41 37

@bjdros
Copy link
Author

bjdros commented Apr 7, 2019

i did as you described and with the customer id 325 which shows the preview window with info

image

but with the customer id 326, the preview window is empty

image

in the headers window, the request has status 200

image

@kevinpapst
Copy link
Member

Hm, now it would be interesting to execute a manual SQL query SELECT * from kimai2_activities WHERE project_ID=1301 and visible=1. I guess there are results, because your screenshot above shows them in the activities overview (at least unless you don't have duplicated project names).

@bjdros
Copy link
Author

bjdros commented Apr 8, 2019

yes i had only 19486 activities but it had to be 4 times that, because of the 4 projects you can choose for each client.
tx for the help. you can close this issue.

@bjdros bjdros closed this as completed Apr 8, 2019
@kevinpapst
Copy link
Member

Wow, thats a lot. Using global activities is no option?
Let me know how it works and if you find any performance problem.

@bjdros
Copy link
Author

bjdros commented Apr 8, 2019

yes would be great to have only 15 global activities , but i did not find yet how to do that.
in administration/activity i see visible and only global on top of the page to choose/set.
but i dont see how to create a global activity?

@kevinpapst
Copy link
Member

Simple: set the project field in the activity to null

@bjdros
Copy link
Author

bjdros commented Apr 8, 2019

wau , you made my day, instead of having 77.760 activities, now i only have 15 global activities !

last question, is there a way when adding a new timesheet , that the last 2 fields (fixed rate and hour rate) wont show ? and so also wont appear in the xlsx file when i do a export to excel ?

@kevinpapst
Copy link
Member

You can control the visibility (for the form) with permissions (check docu for that on the website).
But they are always visible in the export. You could change the export template though, but you have to reset it before the next update. For now they are not configurable like the invoice templates.

@bjdros
Copy link
Author

bjdros commented Apr 10, 2019

hi kevin,
i changed the code in templates/export twig files and the AbstractSpreadsheetRenderer.php file in src/Export so now no more rates on my export screen and not anymore in the excel file.
But for some reason as being SUPER_ADMIN , the menu option System Configuration on the left side does not appear.
What am i doing wrong with the permissions ?

image

below the part of the local.yaml file

    maps:
        # mapping "sets" or permissions to user roles ("role name" = [array of "set names"])
        ROLE_SUPER_ADMIN: [ACTIVITIES,PROJECTS,CUSTOMERS,INVOICE,INVOICE_TEMPLATE,TIMESHEET,TIMESHEET_OTHER,PROFILE,PROFILE_OTHER,USER,RATE,RATE_OTHER,EXPORT]
    roles:
        ROLE_SUPER_ADMIN: [hourly-rate_own_profile,hourly-rate_other_profile,delete_own_profile,roles_own_profile,system_information,system_configuration]

after changing something i always execute these two commands in Git Bash :
$ php.exe console cache:clear --env=prod
$ php.exe console cache:warmup --env=prod

@kevinpapst
Copy link
Member

kevinpapst commented Apr 10, 2019

Looks good to me.
If you still run 0.8.1 the screen does not exist.
Are you running the latest master?
Or in other words: does it appear if you remove the local.yaml and clear the cache?

@bjdros
Copy link
Author

bjdros commented Apr 10, 2019

no, it does not appear after remove local.yaml and clear cache.

i am using now kimai-release-0.9_dev since that one comes with all the vendor APT.

@lock
Copy link

lock bot commented Jun 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.

@lock lock bot locked and limited conversation to collaborators Jun 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants