csoc-de / Shifts

MIT License
30 stars 7 forks source link

After Start "Could not fetch data" #16

Closed schaarra closed 1 year ago

schaarra commented 2 years ago

Hello,

I have try your Shits App in the NC (Version 22.2.2.0) but I get after Installation via Appcenter the Message "Could not fetch data". I can´t do anything and the there are only two Menu Entry on the right site. Do we need also the Application "npm and Node.js" before we install it over the Appcenter ?

2021-12-07 Shits Error

Cheers Schaarra

fkirchesch commented 2 years ago

Hey @schaarra, no, you dont need to install node when getting the app over the Nextcloud Appcenter. Regarding the error, could you check if there are any errors in the nextcloud error log?

Best regards

Fabian

schaarra commented 2 years ago

Hello Fabian,

OK, normaly no other Application needed, if the install over AppCeneter. But I try it to install "npm and Node.js" and don´t fix the Problem.

Yes I get in the nextcloud.log a entry if I start the Shits App see >

`{"reqId":"YbDV1kFvO30WxnP5vSsc5gAABQ4","level":3,"time":"2021-12-08T15:57:10+00:00","remoteAddr":"IP","user":"User","app":"index","method":"GET","url":"/index.php/apps/shifts/getAllAnalysts","message":"Call to a member function getUsers() on null","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.2.0","exception":{"Exception":"Exception","Message":"Call to a member function getUsers() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Shifts\Controller\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Shifts\Controller\ShiftController","getAllAnalysts",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"shifts.shift.getAllAnalysts"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/shifts/getAllAnalysts"]},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"Error","Message":"Call to a member function getUsers() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getAllAnalysts","class":"OCA\Shifts\Controller\ShiftController","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Shifts\Controller\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Shifts\Controller\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Shifts\Controller\ShiftController","getAllAnalysts",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"shifts.shift.getAllAnalysts"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/shifts/getAllAnalysts"]},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/apps/shifts/lib/Controller/ShiftController.php","Line":142},"CustomMessage":"--"}}

Cheers schaarra `

fkirchesch commented 2 years ago

Hey @schaarra, looking at the error message, i can see that there is something wrong with either the Settings set in the Shifts-Settings or the String given to "Name der Schichtmitarbeiter-Gruppe" in the Shifts-Settings does not match any Nextcloud group. Could you check wethere you have set a valid "Name der Schichtmitarbeiter-Gruppe"-String or wethere you have created the group given in this field?

Best regards

Fabian

aljawaid commented 2 years ago

I use v1.8.3 on a new server (migrated nc but didnt have the shifts app)... but i get the same error could not fetch data and also the language text is german

fkirchesch commented 2 years ago

Hey @aljawaid, can you verify that you have set the Settings i have mentioned above and that the given groupname matches to an existing group? Regarding the german text, i have opted into defaulting the text into english, therefor i cannot yet explain this behavior, as the changing of languages on my testmachine works just fine.

Furthermore im working on another update that should at least fix the display of error messages and instead give a warning that the system couldn't find the given groupname.

Best regards

Fabian

aljawaid commented 2 years ago

hello @fkirchesch, I realised that I should have changed the user group to users to match my users group which I did.

I noticed this error in the logging section:

{"reqId":"XV43FPb14r90i8tzBeLB","level":3,"time":"2021-12-16T21:24:08+00:00","remoteAddr":"217.xx.xxx.xxx","user":"xxx","app":"index","method":"GET","url":"/index.php/apps/shifts/getAllAnalysts","message":"Call to a member function getUsers() on null in file '/opt/nextcloud/apps/shifts/lib/Controller/ShiftController.php' line 154","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0","version":"23.0.0.10","exception":{"Exception":"Exception","Message":"Call to a member function getUsers() on null in file '/opt/nextcloud/apps/shifts/lib/Controller/ShiftController.php' line 154","Code":0,"Trace":[{"file":"/opt/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/opt/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/opt/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/opt/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/opt/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"Error","Message":"Call to a member function getUsers() on null","Code":0,"Trace":[{"file":"/opt/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getAllAnalysts","class":"OCA\\Shifts\\Controller\\ShiftController","type":"->"},{"file":"/opt/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/opt/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/opt/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/opt/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/opt/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/opt/nextcloud/apps/shifts/lib/Controller/ShiftController.php","Line":154},"CustomMessage":"--"},"id":"61bbaec5a4c51"}
schaarra commented 2 years ago

Hello Fabian,

I have check the Shifts-Settings and the Groups the are no “Name der Schichtmitarbeiter-Gruppe” in the Settings look, attached >

grafik

In my mind the other Problem, after Installation the are no Group “ShiftsAdmin” and no Analyst in the User Groups, is this right ?

Also Reinstallation the Shits App 1.8.3 doesn’t help to fix the Problems…

{"reqId":"Yb0DnsVqDeR15KnU71SaRgAARx0","level":3,"time":"2021-12-17T21:39:42+00:00","remoteAddr":"IP","user":"User","app":"index","method":"GET","url":"/index.php/apps/shifts/getAllAnalysts","message":"Call to a member function getUsers() on null","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.2.0","exception":{"Exception":"Exception","Message":"Call to a member function getUsers() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Shifts\\Controller\\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Shifts\\Controller\\ShiftController","getAllAnalysts",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"shifts.shift.getAllAnalysts"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/shifts/getAllAnalysts"]},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"Error","Message":"Call to a member function getUsers() on null","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getAllAnalysts","class":"OCA\\Shifts\\Controller\\ShiftController","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Shifts\\Controller\\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Shifts\\Controller\\ShiftController"},"getAllAnalysts"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Shifts\\Controller\\ShiftController","getAllAnalysts",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"shifts.shift.getAllAnalysts"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/shifts/getAllAnalysts"]},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/apps/shifts/lib/Controller/ShiftController.php","Line":154},"CustomMessage":"--"}}

Cheers schaarra

franconianmetal commented 2 years ago

I'm getting around with the user groups, but when i want to add a shift (shift type previously configured), I get a message "Schicht kann nicht angelegt werden" calendar "test" has been added and shared for the configured group and supposed to be synchronised once clicked

while adding shift with date, user selected disappears in menu once I want to save data

nc-version: 22.2.3 Bildschirmfoto vom 2022-01-01 11-43-59 Bildschirmfoto vom 2022-01-01 11-44-11 Bildschirmfoto vom 2022-01-01 11-44-32 Bildschirmfoto vom 2022-01-01 11-25-25

log: {"reqId":"w8tVl0yfJtdxusAHk5d8","level":3,"time":"2022-01-01T10:25:20+00:00","remoteAddr":"192.168.1.140","user":"admin","app":"index","method":"POST","url":"/index.php/apps/shifts/shifts","message":"Argument 1 passed to OCA\\Shifts\\Controller\\ShiftController::create() must be of the type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 217","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0","version":"22.2.3.0","exception":{"Exception":"Exception","Message":"Argument 1 passed to OCA\\Shifts\\Controller\\ShiftController::create() must be of the type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 217","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":158,"Previous":{"Exception":"TypeError","Message":"Argument 1 passed to OCA\\Shifts\\Controller\\ShiftController::create() must be of the type string, null given, called in /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php on line 217","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"create","class":"OCA\\Shifts\\Controller\\ShiftController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/shifts/lib/Controller/ShiftController.php","Line":78},"CustomMessage":"--"}}

fkirchesch commented 2 years ago

Hey @schaarra, unfortunatly the groups are not created by the app itself. You need to create them with any given name and paste this exact name into the fields in the settings window.

I have not yet found a way to automate this process and even so, there are usecases that benefit from the current behaviour of the app regarding user-groups.

Best Regards,

Fabian

fkirchesch commented 2 years ago

Hey @franconianmetal, could you please open another issue as this seems to be an unrelated issue. But as i understand it, the user selection doesn't save itself to the App-State and therefor isnt sent to the api once the shift is saved to the database. I will try to work on this and the original issue asap.

Best regards

Fabian

Starkstromkonsument commented 2 years ago

Please consider adding more informative error messages. I was stuck at the same point, because I did not create the groups. Thank You.

sonaxpro commented 1 year ago

my solution https://github.com/csoc-de/Shifts/issues/36#issue-1802967731

csoc-kevink commented 1 year ago

Close due to new version and fix